<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><div dir="ltr">Yes, i have tried this, but it didn't help at all.<div><br></div><div>Commands (judging from printed stack trace, they're equivalent):</div><div><div>xmlsec1 --verify --id-attr:ID saml2p:Response test.xml</div><div>xmlsec1 --verify test.xml</div><div><br></div><div>XML file (trimmed, but you'll get the idea):</div><div><div><saml2p:Response xmlns:saml2p="urn:oasis:names:tc:SAML:2.0:protocol"</div><div> ID="uuid-fb4f8863-062c-41bd-95d9-dc7f77ccf453"<span style="font-size:12pt;">></span></div><div> <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#"></div><div> <ds:SignedInfo></div><div> <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></div><div> <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /></div><div> <ds:Reference URI="#uuid-fb4f8863-062c-41bd-95d9-dc7f77ccf453"></div><div> <ds:Transforms></div><div> <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></div><div> <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" /></div><div> </ds:Transforms></div><div> <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /></div><div> <ds:DigestValue>lAcsILQxRk4LvbSfREkypyI6gMc=</ds:DigestValue></div><div> </ds:Reference></div><div> </ds:SignedInfo></div><div> <ds:SignatureValue>gT/SeC..bjrQ==</ds:SignatureValue></div><div> <ds:KeyInfo></div><div> <ds:X509Data></div><div> <ds:X509Certificate>MII..A==</ds:X509Certificate></div><div> </ds:X509Data></div><div><span class="ecxApple-tab-span" style="white-space:pre;"> </span>..</div><div> </ds:KeyInfo></div><div> </ds:Signature></div></div><div><br></div><div>According to FAQ, I should have declare name of ID element, but in my case it is "ID". And yet, it still does display the error. Following the FAQ, point 3.4 states that I am probably using Visa 3-D files, but again, that is not an option here.</div><div><br></div><div>It's highly likely that I just do not understand *how* to use xmlsec1 and doing it plain wrong. That said, please take a look and check where am I wrong.</div><div><br></div><div>Artur</div><br><div>> Subject: Re: [xmlsec] xmlsec returns error when trying to validate SAML response<br>> To: artur513@outlook.com; xmlsec@aleksey.com<br>> From: aleksey@aleksey.com<br>> Date: Tue, 1 Mar 2016 09:30:18 -0800<br>> <br>> FAQ, section 3.2 (if I recall correctly).<br>> <br>> Aleksey<br>> <br>> On 3/1/16 8:57 AM, Artur Rychlewicz wrote:<br>> > <br>> > <br>> > Hello,<br>> > <br>> > I've been trying to use xmlsec1 to validate signed XML response<br>> > containing SAML data.<br>> > <br>> > When I execute:<br>> > <br>> > xmlsec1 --verify test.xml<br>> > <br>> > I receive following stack trace:<br>> > <br>> > func=xmlSecXPathDataExecute:file=xpath.c:line=273:obj=unknown:subj=xmlXPtrEval:error=5:libxml2<br>> > library function<br>> > failed:expr=xpointer(id('uuid-73c06e86-88d2-4204-91f4-3d484bc782cc'))<br>> > func=xmlSecXPathDataListExecute:file=xpath.c:line=373:obj=unknown:subj=xmlSecXPathDataExecute:error=1:xmlsec<br>> > library function failed:<br>> > func=xmlSecTransformXPathExecute:file=xpath.c:line=483:obj=xpointer:subj=xmlSecXPathDataExecute:error=1:xmlsec<br>> > library function failed:<br>> > func=xmlSecTransformDefaultPushXml:file=transforms.c:line=2411:obj=xpointer:subj=xmlSecTransformExecute:error=1:xmlsec<br>> > library function failed:<br>> > func=xmlSecTransformCtxXmlExecute:file=transforms.c:line=1242:obj=unknown:subj=xmlSecTransformPushXml:error=1:xmlsec<br>> > library function failed:transform=xpointer<br>> > func=xmlSecTransformCtxExecute:file=transforms.c:line=1302:obj=unknown:subj=xmlSecTransformCtxXmlExecute:error=1:xmlsec<br>> > library function failed:<br>> > func=xmlSecDSigReferenceCtxProcessNode:file=xmldsig.c:line=1589:obj=unknown:subj=xmlSecTransformCtxExecute:error=1:xmlsec<br>> > library function failed:<br>> > func=xmlSecDSigCtxProcessSignedInfoNode:file=xmldsig.c:line=822:obj=unknown:subj=xmlSecDSigReferenceCtxProcessNode:error=1:xmlsec<br>> > library function failed:node=Reference<br>> > func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=563:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec<br>> > library function failed:<br>> > func=xmlSecDSigCtxVerify:file=xmldsig.c:line=382:obj=unknown:subj=xmlSecDSigCtxSignatureProcessNode:error=1:xmlsec<br>> > library function failed:<br>> > Error: signature failed<br>> > ERROR<br>> > SignedInfo References (ok/all): 0/1<br>> > Manifests References (ok/all): 0/0<br>> > Error: failed to verify file "test.xml"<br>> > <br>> > I do not know how XML signatures work, but I presume that the ID was<br>> > taken from <saml2p:Response> tag which contains ID with value of<br>> > "uuid-73c06e86-88d2-4204-91f4-3d484bc782cc". <saml2p:Response> element<br>> > contains <ds:Signature> element which in turn contains <ds:Reference><br>> > with parameter URI="#uuid-73c06e86-88d2-4204-91f4-3d484bc782cc".<br>> > <br>> > Since I do not need this value/data, I'd like to check signature of<br>> > <saml2:Assertion> element which also contains it's own <ds:Signature> value.<br>> > <br>> > That said, I'd like to ask you for instruction how to validate element I<br>> > need. Thank you in advance.<br>> > <br>> > Best regards,<br>> > Artur Rychlewicz<br>> > <br>> > <br>> > _______________________________________________<br>> > xmlsec mailing list<br>> > xmlsec@aleksey.com<br>> > http://www.aleksey.com/mailman/listinfo/xmlsec<br>> > <br></div></div> </div></div><style><!--
.ExternalClass .ecxhmmessage P {
padding:0px;
}
.ExternalClass body.ecxhmmessage {
font-size:12pt;
font-family:Calibri;
}
--></style> </div></body>
</html>