You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@santuario.apache.org by Grzegorz Kowalski <gr...@acn.waw.pl> on 2003/07/17 23:56:09 UTC

signature validation exception

Hi,

I am using XML Dsig in a web application deployed on Tomcat 4.1.24. When
I try to validate a document I get an exception: 

org.apache.xml.security.transforms.TransformationException: Cannot find
http://www.w3.org/2002/06/xmldsig-filter2 in XPath

Everything works fine when I execute a similar snippet of code like the
one in my servlet directly from the Eclipse workbench. I don't think the
problem is related to some libraries missing on the server side, but
have no other ideas. Below I attach a fragment of the stack trace.

I am really stuck here and I will be very thankful for any help.

Grzesiek

--------------------------------
This is the result of calling the checkSignatureValue(certificate) on
XMLSignature object:

org.apache.xml.security.transforms.TransformationException: Cannot find
http://www.w3.org/2002/06/xmldsig-filter2 in XPath
        at
org.apache.xml.security.transforms.implementations.TransformXPath2Filter
.enginePerformTransform(TransformXPath2Filter.java:169)
        at
org.apache.xml.security.transforms.Transform.performTransform(Transform.
java:333)
        at
org.apache.xml.security.transforms.Transforms.performTransforms(Transfor
ms.java:260)
        at
org.apache.xml.security.signature.Reference.getContentsAfterTransformati
on(Reference.java:510)
        at
org.apache.xml.security.signature.Reference.dereferenceURIandPerformTran
sforms(Reference.java:701)
        at
org.apache.xml.security.signature.Reference.getReferencedBytes(Reference
.java:765)
        at
org.apache.xml.security.signature.Reference.calculateDigest(Reference.ja
va:790)
        at
org.apache.xml.security.signature.Reference.verify(Reference.java:824)
        at
org.apache.xml.security.signature.Manifest.verifyReferences(Manifest.jav
a:354)
        at
org.apache.xml.security.signature.SignedInfo.verify(SignedInfo.java:240)
        at
org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
gnature.java:621)
        at
org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
gnature.java:588)



Re: signature validation exception

Posted by Karel Wouters <Ka...@esat.kuleuven.ac.be>.
Hi,

if possible, please give an example of your problem. Ideally, this would
be the XML document before it is sent, and then the stuff you retrieve.
Because your References are OK, I assume that you are referring to
content, external to the document? If so, you might try adding a reference
to content within the transferred XML doc.
(if that fails to verify, you're sure that something fishy has happened
during transfer :)

Karel.

On Mon, 21 Jul 2003, Grzegorz Kowalski wrote:

> Berin,
>
> The problem was due to my mistake, which I made in a piece of code that
> reads XML from a database  - I was reading some crap from Xindice
> (definitely not the same document I was validating locally).
>
> Now I am facing another issue: I have an applet that signs a document,
> puts it into a HTML form and submits it. When I try to validate the XML
> code retrieved from a request parameter in a servlet, verification
> fails. Digest verification is successful though, so I think this must be
> related to difference in whitespace.
>
> Am I right? If so - why is the content changed on the way from the
> browser to tomcat?
>
> Thanks for help,
> Grzesiek
>
> > Grzesiek,
> >
> > Don't know if following migt help.
> >
> > http://nagoya.apache.org/eyebrowse/ReadMsg?listName=security-dev@xml.apache.org&msgId=737131
> >
> >
> > If not - could you put a bug report and code/XML snippet on bugzilla?
> >
> > Cheers,
> >     Berin
> >
> > Grzegorz Kowalski wrote:
> >
> >> Hi,
> >>
> >> I am using XML Dsig in a web application deployed on Tomcat 4.1.24. When
> >> I try to validate a document I get an exception:
> >> org.apache.xml.security.transforms.TransformationException: Cannot find
> >> http://www.w3.org/2002/06/xmldsig-filter2 in XPath
> >>
> >> Everything works fine when I execute a similar snippet of code like the
> >> one in my servlet directly from the Eclipse workbench. I don't think the
> >> problem is related to some libraries missing on the server side, but
> >> have no other ideas. Below I attach a fragment of the stack trace.
> >>
> >> I am really stuck here and I will be very thankful for any help.
> >>
> >> Grzesiek
> >>
> >> --------------------------------
> >> This is the result of calling the checkSignatureValue(certificate) on
> >> XMLSignature object:
> >>
> >> org.apache.xml.security.transforms.TransformationException: Cannot find
> >> http://www.w3.org/2002/06/xmldsig-filter2 in XPath
> >>         at
> >> org.apache.xml.security.transforms.implementations.TransformXPath2Filter
> >> .enginePerformTransform(TransformXPath2Filter.java:169)
> >>         at
> >> org.apache.xml.security.transforms.Transform.performTransform(Transform.
> >> java:333)
> >>         at
> >> org.apache.xml.security.transforms.Transforms.performTransforms(Transfor
> >> ms.java:260)
> >>         at
> >> org.apache.xml.security.signature.Reference.getContentsAfterTransformati
> >> on(Reference.java:510)
> >>         at
> >> org.apache.xml.security.signature.Reference.dereferenceURIandPerformTran
> >> sforms(Reference.java:701)
> >>         at
> >> org.apache.xml.security.signature.Reference.getReferencedBytes(Reference
> >> .java:765)
> >>         at
> >> org.apache.xml.security.signature.Reference.calculateDigest(Reference.ja
> >> va:790)
> >>         at
> >> org.apache.xml.security.signature.Reference.verify(Reference.java:824)
> >>         at
> >> org.apache.xml.security.signature.Manifest.verifyReferences(Manifest.jav
> >> a:354)
> >>         at
> >> org.apache.xml.security.signature.SignedInfo.verify(SignedInfo.java:240)
> >>         at
> >> org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
> >> gnature.java:621)
> >>         at
> >> org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
> >> gnature.java:588)
> >>
> >>
> >>
> >
> >
>
>

Re: signature validation exception

Posted by Grzegorz Kowalski <gr...@acn.waw.pl>.
Berin,

The problem was due to my mistake, which I made in a piece of code that 
reads XML from a database  - I was reading some crap from Xindice 
(definitely not the same document I was validating locally).

Now I am facing another issue: I have an applet that signs a document, 
puts it into a HTML form and submits it. When I try to validate the XML 
code retrieved from a request parameter in a servlet, verification 
fails. Digest verification is successful though, so I think this must be 
related to difference in whitespace.

Am I right? If so - why is the content changed on the way from the 
browser to tomcat?

Thanks for help,
Grzesiek

> Grzesiek,
> 
> Don't know if following migt help.
> 
> http://nagoya.apache.org/eyebrowse/ReadMsg?listName=security-dev@xml.apache.org&msgId=737131 
> 
> 
> If not - could you put a bug report and code/XML snippet on bugzilla?
> 
> Cheers,
>     Berin
> 
> Grzegorz Kowalski wrote:
> 
>> Hi,
>>
>> I am using XML Dsig in a web application deployed on Tomcat 4.1.24. When
>> I try to validate a document I get an exception:
>> org.apache.xml.security.transforms.TransformationException: Cannot find
>> http://www.w3.org/2002/06/xmldsig-filter2 in XPath
>>
>> Everything works fine when I execute a similar snippet of code like the
>> one in my servlet directly from the Eclipse workbench. I don't think the
>> problem is related to some libraries missing on the server side, but
>> have no other ideas. Below I attach a fragment of the stack trace.
>>
>> I am really stuck here and I will be very thankful for any help.
>>
>> Grzesiek
>>
>> --------------------------------
>> This is the result of calling the checkSignatureValue(certificate) on
>> XMLSignature object:
>>
>> org.apache.xml.security.transforms.TransformationException: Cannot find
>> http://www.w3.org/2002/06/xmldsig-filter2 in XPath
>>         at
>> org.apache.xml.security.transforms.implementations.TransformXPath2Filter
>> .enginePerformTransform(TransformXPath2Filter.java:169)
>>         at
>> org.apache.xml.security.transforms.Transform.performTransform(Transform.
>> java:333)
>>         at
>> org.apache.xml.security.transforms.Transforms.performTransforms(Transfor
>> ms.java:260)
>>         at
>> org.apache.xml.security.signature.Reference.getContentsAfterTransformati
>> on(Reference.java:510)
>>         at
>> org.apache.xml.security.signature.Reference.dereferenceURIandPerformTran
>> sforms(Reference.java:701)
>>         at
>> org.apache.xml.security.signature.Reference.getReferencedBytes(Reference
>> .java:765)
>>         at
>> org.apache.xml.security.signature.Reference.calculateDigest(Reference.ja
>> va:790)
>>         at
>> org.apache.xml.security.signature.Reference.verify(Reference.java:824)
>>         at
>> org.apache.xml.security.signature.Manifest.verifyReferences(Manifest.jav
>> a:354)
>>         at
>> org.apache.xml.security.signature.SignedInfo.verify(SignedInfo.java:240)
>>         at
>> org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
>> gnature.java:621)
>>         at
>> org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
>> gnature.java:588)
>>
>>
>>
> 
> 



Re: signature validation exception

Posted by Berin Lautenbach <be...@ozemail.com.au>.
Grzesiek,

Don't know if following migt help.

http://nagoya.apache.org/eyebrowse/ReadMsg?listName=security-dev@xml.apache.org&msgId=737131

If not - could you put a bug report and code/XML snippet on bugzilla?

Cheers,
	Berin

Grzegorz Kowalski wrote:
> Hi,
> 
> I am using XML Dsig in a web application deployed on Tomcat 4.1.24. When
> I try to validate a document I get an exception: 
> 
> org.apache.xml.security.transforms.TransformationException: Cannot find
> http://www.w3.org/2002/06/xmldsig-filter2 in XPath
> 
> Everything works fine when I execute a similar snippet of code like the
> one in my servlet directly from the Eclipse workbench. I don't think the
> problem is related to some libraries missing on the server side, but
> have no other ideas. Below I attach a fragment of the stack trace.
> 
> I am really stuck here and I will be very thankful for any help.
> 
> Grzesiek
> 
> --------------------------------
> This is the result of calling the checkSignatureValue(certificate) on
> XMLSignature object:
> 
> org.apache.xml.security.transforms.TransformationException: Cannot find
> http://www.w3.org/2002/06/xmldsig-filter2 in XPath
>         at
> org.apache.xml.security.transforms.implementations.TransformXPath2Filter
> .enginePerformTransform(TransformXPath2Filter.java:169)
>         at
> org.apache.xml.security.transforms.Transform.performTransform(Transform.
> java:333)
>         at
> org.apache.xml.security.transforms.Transforms.performTransforms(Transfor
> ms.java:260)
>         at
> org.apache.xml.security.signature.Reference.getContentsAfterTransformati
> on(Reference.java:510)
>         at
> org.apache.xml.security.signature.Reference.dereferenceURIandPerformTran
> sforms(Reference.java:701)
>         at
> org.apache.xml.security.signature.Reference.getReferencedBytes(Reference
> .java:765)
>         at
> org.apache.xml.security.signature.Reference.calculateDigest(Reference.ja
> va:790)
>         at
> org.apache.xml.security.signature.Reference.verify(Reference.java:824)
>         at
> org.apache.xml.security.signature.Manifest.verifyReferences(Manifest.jav
> a:354)
>         at
> org.apache.xml.security.signature.SignedInfo.verify(SignedInfo.java:240)
>         at
> org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
> gnature.java:621)
>         at
> org.apache.xml.security.signature.XMLSignature.checkSignatureValue(XMLSi
> gnature.java:588)
> 
> 
>