<div dir="ltr">hello,<br>When I verify the signature I got the following error:<br>func=xmlSecOpenSSLEvpDigestVerify:file=digests.c:line=229:obj=sha1:subj=unknown:error=12:invalid data:data and digest do not match<br><br>The point is I can use the same code to verify some other xml signature except this one which I got response from other&#39;s Web Service.<br>
Could you check the following xml piece to see whether&nbsp; there is something&nbsp; which cause this error? Could it possible caused by &quot;&lt;ec:InclusiveNamespaces xmlns:ec=&quot;<a href="http://www.w3.org/2001/10/xml-exc-c14n#">http://www.w3.org/2001/10/xml-exc-c14n#</a>&quot; PrefixList=&quot;ds saml xs&quot;/&gt;&quot; which seems not exist in my own generating response.<br>
<br>Thanks<br>Weizhong Qiang<br><br><br>**********************<br><br>&lt;saml:Assertion xmlns:saml=&quot;urn:oasis:names:tc:SAML:2.0:assertion&quot; ID=&quot;_4f357ca2-ad38-4611-8dfd-f5e4d193d95c&quot; IssueInstant=&quot;2008-10-09T15:48:59.621Z&quot; Version=&quot;2.0&quot;&gt;&lt;saml:Issuer&gt;CN=Weizhong Qiang,OU=<a href="http://fys.uio.no">fys.uio.no</a>,O=NorduGrid,O=Grid&lt;/saml:Issuer&gt;&lt;ds:Signature xmlns:ds=&quot;<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>&quot;&gt;<br>
&lt;ds:SignedInfo&gt;<br>&lt;ds:CanonicalizationMethod Algorithm=&quot;<a href="http://www.w3.org/2001/10/xml-exc-c14n#">http://www.w3.org/2001/10/xml-exc-c14n#</a>&quot;/&gt;<br>&lt;ds:SignatureMethod Algorithm=&quot;<a href="http://www.w3.org/2000/09/xmldsig#rsa-sha1">http://www.w3.org/2000/09/xmldsig#rsa-sha1</a>&quot;/&gt;<br>
&lt;ds:Reference URI=&quot;#_4f357ca2-ad38-4611-8dfd-f5e4d193d95c&quot;&gt;<br>&lt;ds:Transforms&gt;<br>&lt;ds:Transform Algorithm=&quot;<a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature">http://www.w3.org/2000/09/xmldsig#enveloped-signature</a>&quot;/&gt;<br>
&lt;ds:Transform Algorithm=&quot;<a href="http://www.w3.org/2001/10/xml-exc-c14n#">http://www.w3.org/2001/10/xml-exc-c14n#</a>&quot;&gt;&lt;ec:InclusiveNamespaces xmlns:ec=&quot;<a href="http://www.w3.org/2001/10/xml-exc-c14n#">http://www.w3.org/2001/10/xml-exc-c14n#</a>&quot; PrefixList=&quot;ds saml xs&quot;/&gt;&lt;/ds:Transform&gt;<br>
&lt;/ds:Transforms&gt;<br>&lt;ds:DigestMethod Algorithm=&quot;<a href="http://www.w3.org/2000/09/xmldsig#sha1">http://www.w3.org/2000/09/xmldsig#sha1</a>&quot;/&gt;<br>&lt;ds:DigestValue&gt;6GUoFLrpxDGrP3b8nYToGuTGDkQ=&lt;/ds:DigestValue&gt;<br>
&lt;/ds:Reference&gt;<br>&lt;/ds:SignedInfo&gt;<br>&lt;ds:SignatureValue&gt;<br>Tv8kUkw0Lvplsa5WY/GfT5TW2ggxsKCFp9p+VEBLIcHQATy/kCUDQiPLeBT8ZcgOB6YFR/xo3848<br>GWBX4GwtREGAhIznm6GSic67lnfvpwzb/GQhxVZf+YnIvPfpytAutmM2dSm03ZTO8tPXBfG4Tcyu<br>
kqHPcwnZs34BaWKss2I=<br>&lt;/ds:SignatureValue&gt;<br>&lt;ds:KeyInfo&gt;&lt;ds:X509Data&gt;&lt;ds:X509Certificate&gt;MIIDMjCCApugAwIBAgICC3kwDQYJKoZIhvcNAQEFBQAwTzENMAsGA1UEChMER3JpZDESMBAGA1UE<br>ChMJTm9yZHVHcmlkMSowKAYDVQQDEyFOb3JkdUdyaWQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw<br>
HhcNMDgwNDE2MDk1NzUxWhcNMDkwNDE2MDk1NzUxWjBRMQ0wCwYDVQQKEwRHcmlkMRIwEAYDVQQK<br>EwlOb3JkdUdyaWQxEzARBgNVBAsTCmZ5cy51aW8ubm8xFzAVBgNVBAMTDldlaXpob25nIFFpYW5n<br>MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCwVJsM8PUkeBVSRXWbmlwSvIxwOMvDnw0CbM4k<br>
d9EBZBjjaW/TTwBfKiTuLyONSQ3BV9APndWXPoqNy3F7cZbsA9IeIalOi0KtVtNVktybspEGJZRy<br>FN+kprbLJKoEViOB8q1DG0rv09zWA7n6qRFJcKqzePzsKy8Zo/bL3bI85QIDAQABo4IBGTCCARUw<br>CQYDVR0TBAIwADARBglghkgBhvhCAQEEBAMCBaAwCwYDVR0PBAQDAgXgMCwGCWCGSAGG+EIBDQQf<br>
Fh1PcGVuU1NMIEdlbmVyYXRlZCBDZXJ0aWZpY2F0ZTAdBgNVHQ4EFgQUfkmW6yooaz8IDx6cd2BK<br>7RUrDjcwdwYDVR0jBHAwboAUGAXA/AvRtzr0ZZIJ+1mhX8eIxPChU6RRME8xDTALBgNVBAoTBEdy<br>aWQxEjAQBgNVBAoTCU5vcmR1R3JpZDEqMCgGA1UEAxMhTm9yZHVHcmlkIENlcnRpZmljYXRpb24g<br>
QXV0aG9yaXR5ggEAMCIGA1UdEQQbMBmBF3dlaXpob25ncWlhbmdAZ21haWwuY29tMA0GCSqGSIb3<br>DQEBBQUAA4GBABgih1dwIS2FDdMlzO/pucYju87s8V1xcVxxjh7jYeSbOgmc3rWfohKkkvomtmnJ<br>22Ae0mfN/sNaZVwxO82XNej5lob8xp+iroYM+Rrt6ZnhWDNaMuIKTbFA/HgfnTcZjrPm5ttNYorb<br>
qDCr7j/ab0xkaTwQYVjnJc0lyjaWGsdL&lt;/ds:X509Certificate&gt;&lt;/ds:X509Data&gt;&lt;/ds:KeyInfo&gt;&lt;/ds:Signature&gt;&lt;saml:Subject&gt;&lt;saml:NameID Format=&quot;urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName&quot;&gt;CN=test,O=UiO,ST=Oslo,C=NO&lt;/saml:NameID&gt;&lt;saml:SubjectConfirmation Method=&quot;urn:oasis:names:tc:SAML:2.0:cm:holder-of-key&quot;&gt;&lt;saml:SubjectConfirmationData&gt;&lt;ds:KeyInfo xmlns:ds=&quot;<a href="http://www.w3.org/2000/09/xmldsig#">http://www.w3.org/2000/09/xmldsig#</a>&quot;&gt;&lt;ds:X509Data&gt;&lt;ds:X509Certificate&gt;MIICozCCAgygAwIBAgIBATANBgkqhkiG9w0BAQQFADA3MQswCQYDVQQGEwJOTzENMAsGA1UECBME<br>
T3NsbzEMMAoGA1UEChMDVWlPMQswCQYDVQQDEwJDQTAeFw0wNzExMDYxNTE4NDlaFw0wODExMDUx<br>NTE4NDlaMDkxCzAJBgNVBAYTAk5PMQ0wCwYDVQQIEwRPc2xvMQwwCgYDVQQKEwNVaU8xDTALBgNV<br>BAMTBHRlc3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMUZpDYNYNuoqohEkP4w/MnGAiXV<br>
sZUSPuFChL2HT2sE7VQ2/RsFKRyAFXNaBIPcpoJF2uTv6Llc0G9F5v4G5ZyZiiexgl3HtnmiMcgW<br>ie/d5XfYf0o+2xhofdsgxb5d2DRFyUVxkKnBRYSSebR9wsdlwtlduSDxsN22CFITqL3FAgMBAAGj<br>gbwwgbkwCQYDVR0TBAIwADAsBglghkgBhvhCAQ0EHxYdT3BlblNTTCBHZW5lcmF0ZWQgQ2VydGlm<br>
aWNhdGUwHQYDVR0OBBYEFGtX2cUVfSVs1xLKLwwscpNon2duMF8GA1UdIwRYMFaAFLg5jUhGbh+u<br>jBIx6kabFY+E5JrWoTukOTA3MQswCQYDVQQGEwJOTzENMAsGA1UECBMET3NsbzEMMAoGA1UEChMD<br>VWlPMQswCQYDVQQDEwJDQYIBADANBgkqhkiG9w0BAQQFAAOBgQAIrqV+I9YbXvpsRvwJLOFIVIuX<br>
Cy8l5RjfSrd4UG3oX3c0nmr5oe93XomAJ525ULOGSh5w8kmfGA96yUi2LRmdM9ZQyyVWLDagU0dt<br>mdcJm2CedeRxI+ShtIE3PRc/OTEjz/dvY6gD/jiHDUr/IcooHMSApIuDZXWvSNWSql0Swg==&lt;/ds:X509Certificate&gt;&lt;/ds:X509Data&gt;&lt;/ds:KeyInfo&gt;&lt;/saml:SubjectConfirmationData&gt;&lt;/saml:SubjectConfirmation&gt;&lt;/saml:Subject&gt;&lt;saml:Conditions NotBefore=&quot;2008-10-09T15:48:59.621Z&quot; NotOnOrAfter=&quot;2008-10-10T02:48:59.621Z&quot;/&gt;&lt;saml:AttributeStatement&gt;&lt;saml:Attribute Name=&quot;Degree&quot; NameFormat=&quot;urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified&quot;&gt;&lt;saml:AttributeValue xsi:type=&quot;xs:string&quot;&gt;PhD&lt;/saml:AttributeValue&gt;&lt;/saml:Attribute&gt;&lt;saml:Attribute Name=&quot;<a href="http://voms.forge.cnaf.infn.it/group">http://voms.forge.cnaf.infn.it/group</a>&quot; NameFormat=&quot;urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified&quot;&gt;&lt;saml:AttributeValue xsi:type=&quot;xs:string&quot;&gt;/knowarc&lt;/saml:AttributeValue&gt;&lt;saml:AttributeValue xsi:type=&quot;xs:string&quot;&gt;/knowarc/UiO&lt;/saml:AttributeValue&gt;&lt;/saml:Attribute&gt;&lt;/saml:AttributeStatement&gt;&lt;/saml:Assertion&gt;<br>
</div>