[xmlsec] error in Reference URI

Alexandre Kalendarev akalend at mail.ru
Sun Sep 3 23:10:13 PDT 2006


Hi Aleksey,

I have error of signing document. If I use code dsig1 from examples and templates sign1-tmpl.xml result is Ok.
But, if I move data tag to end of template  and change the URI attribute of the Reference element, I have errors:

func=xmlSecXPathDataExecute:file=xpath.c:line=273:obj=unknown:subj=xmlXPtrEval:error=5:libxml2 library function failed:expr=xpointer(id('body'))
func=xmlSecXPathDataListExecute:file=xpath.c:line=356:obj=unknown:subj=xmlSecXPathDataExecute:error=1:xmlsec library function failed: 
...
func=xmlSecDSigCtxProcessSignatureNode:file=xmldsig.c:line=547:obj=unknown:subj=xmlSecDSigCtxProcessSignedInfoNode:error=1:xmlsec library function failed: 
func=xmlSecDSigCtxSign:file=xmldsig.c:line=303:obj=unknown:subj=xmlSecDSigCtxSigantureProcessNode:error=1:xmlsec library function failed: 
Error: signature failed 
Error: failed to sign file "sign2-tmpl.xml"

The new template is:

<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="urn:envelope">
  <Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
    <SignedInfo>
      <CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" />
      <SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
      <Reference URI="#body">
        <Transforms>
          <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
        </Transforms>
        <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
        <DigestValue></DigestValue>
      </Reference>
    </SignedInfo>
    <SignatureValue/>
    <KeyInfo>
        <KeyName/>
    </KeyInfo>
  </Signature>
 <env:body env:Id="body">
   <data>this test data</data>
 </env:body>
</env:Envelope>

As I understanding, the error is in the libxml2 library. I use the version 2.6.19 of libxml. 
How is correct version?. Have I correct template or code?



Alexandre.





More information about the xmlsec mailing list