-
Notifications
You must be signed in to change notification settings - Fork 22
Signature shouldn't ever be valid #3
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
Comments
We can confirm this issue. |
I may create a PR the next days. But first i need to separate that fix from all the other bad things i've done to the code in the forked repo. Update: I will provide an PR at the 20th October. I'll use a hackathon to clean up my repository and provide the fix, as well as some other improvements and extensions to this. |
@Nerzal, I don't understand your issue, and I'm afraid that you may be misusing the library. It definitely creates valid signatures for my use cases so "never match" definitely isn't true. |
@amdonov i'll try to clarify the problem: The library does create a valid signature for the canonicalized XML. That's true. The Problem is, the library does not return the canonicalized XML in any form. So there are 2 possibilities:
Why do i think, that this is necessary? What does my validator do? The digest does not match, when signing the xml with this library and using the "encoding/xml" marshaller to marshal the body. Why is that so? I hope that clearifies the Problem. Btw: with some changes the XML canonicalization of all XML that i have works pretty well :) |
If possible, please post a snippet of code where you create your signature and marshal the resulting struct to XML. I'll take a look. For a straightforward real world example of the library in use see, https://github.com/amdonov/lite-idp/blob/master/sp/metadata.go. It generates and signs a SAML metadata XML element. |
Hi there, I really liked the way your lib works. But I'm stumbled upon the same problem that @Nerzal. The web service that I'm talking to, says that signature doesn't match. Probably what's happening is what Nerval mentioned. will it have some PR to fix it? |
@RenathoAzevedo, same comment that I provided to @Nerzal. If you post your code, I'll take a look at it. |
hey @renathoaz , are you using that lib to sign XML of NFE? I'm trying to do the same, did you make it work? |
Steps to Reproduce
Description of the Problem
In the Process of creating the signature, the data is canonicalized etc. and in the end of that process this altered data is used to calculate the digest.
While validating the signature, you'd take this digest and the data you have and calculate the digest on your own.
So whats the Problem?
The Method CreateSignature only returns an signature object, but not the canonicalized and transformed, etc. xml data. So the data in the signature and the data we use will never match.
When does the Problem apply?
The Problem applies mostly when using enveloped signature algorithm (http://www.w3.org/2000/09/xmldsig#enveloped-signature)
The text was updated successfully, but these errors were encountered: