-
Notifications
You must be signed in to change notification settings - Fork 177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If you failed verifying XML signature, read this #158
Comments
I'm confused about this. The commit that caused this bug was created last year. This issue was opened just a couple weeks ago. I've recently been having trouble verifying xml signature about and came across this, but I'm wondering if this is actually the cause of my issue. |
Let me clarify my question. |
Hi @VincentNewkirk It is possible that your issue is in XML signature itself, not the commit created last year. Either way, I cannot say where the root cause of your issue stands. |
Can implicitTransforms be used for signing XMLs as well? |
Summary
At the latest commit(6e22854), there is a known bug for handling non-exclusive canonicalization.
If your failing XML contains canonicalization method like these
then, you have a chance you can verify signature using patched version of xml-crypto
If it doesn't, you still have a chance. Please read this post carefully.
Install
I created fixed version of
xml-crypto
here.You can install it by the command below.
Note: If you already installed
xml-crypto
, uninstall it first.Note: Implicit transform
The specification of XML signature is bit complicated, thus there seems to be many XML signed in wrong way.
One of those misunderstanding is Implicit transform.
XML signature should be verified after it is transformed by an algorithm specified in
<Transform Algorithm='...'>
.For example, transform
http://www.w3.org/2000/09/xmldsig#enveloped-signature
is often applied to almost all signed XML.This transform strips off
<Signature>
element from XML being verified.Although every transform being applied should be defined in
<Transform>
, so many XML signer adds implicit transform without describing it to<Transform>
.Sometimes it is
http://www.w3.org/TR/2001/REC-xml-c14n-20010315
, and sometimeshttp://www.w3.org/2001/10/xml-exc-c14n#
.So I added an option to specify additional Transform Algorithm which might be hidden but actually applied.
Example:
Long version:
This is just an option which might solve your problem.
Hope you have a good luck.
What implicit transform is applied
I cannot say which. It depends on signers.
You have to try one by one.
Possible candidates might be as follows:
http://www.w3.org/2001/10/xml-exc-c14n#
http://www.w3.org/TR/2001/REC-xml-c14n-20010315
http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments
The text was updated successfully, but these errors were encountered: