-
Notifications
You must be signed in to change notification settings - Fork 173
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
Can't get XML digests to match. Possible canonicalization problem? #43
Comments
Hi @archa347 Can you force passport to use [email protected] and check if that works? |
I don't have much control over the server side, unfortunately. The XML is being generated and signed by a CA SIteMinder SAML identity provider. The passport-saml library does the validation on our end as the SAML consumer. The XML is sent over the wire as base64 encoded text. The XML text was base64 encoded with CRLF line endings. I found that after stripping CR's out of the text after decoding from base64 but before validation, it will pass. Otherwise, after c14n canonicalization we end up with |
thanks Which xml-crypto version do you have installed? Can you force passport to use [email protected] and check if that works? Following case #39 we have changed the xml parser dependency and this possibly affected the xml parsing. |
passport-saml installs with [email protected]. I forced it to 0.1.25 and still had the same issues. |
thanks for the information for now are you able to use the workaround you mentioned? |
The CRLF's are encoded in the base64, so I think they were part of the original XML as transmitted by the server. We do have a work-around in removing CR characters from the XML after decoding. I'll need to check to make sure I can post the full base64, I don't want to accidentally release any potentially secure information |
Do you use node to verify a signature that originates from a Microsoft .Net / Windows Store signature? trying to understand if this originates from this issue or not: |
No, the XML is coming from a proprietary software called SiteMinder by CA. Its a single sign on provider. |
I'm struggling with this aswell. It seems like some problem regarding canonicalization, since the signature matching is OK (at least in my case), and theres no BTW Im using Okta in parallel and works fine. It seems like a problem with different IPs (maybe with the OS?) |
@matiasdecarli - if you remove white space is it also ok? also what do you mean that the signature match is ok - if the digests are different than the signature will also be different. |
Using the What I mean with the signature match is ok, is that Regarding the IPs: yes. It works with Okta, but it fails when I'm using another one (Im not sure which one is since this is a 3rd party provider) |
ignoreWhiteSpace will not work with xmldom but only with xmldom-fork-fixed. instead, can you manually remove all whitespace, just to check? can you send me the xml and the signature? |
Actually im using xmldom-fork-fixed => This is specifically where the problem is |
Can I reach you via email to show you this stuff? Thanks in advance. |
sure, [email protected] note that I will take a look once I have free time (this requires some On Thu, Apr 16, 2015 at 5:50 PM, Matias De Carli [email protected]
I'm on Twitter (@YaronNaveh http://twitter.com/#!/YaronNaveh) |
I totally understand, yes. Thanks |
@yaronn Could you see the data? It looks like the encoding its the same, but the assertion has a different format. I've tried adding |
I think I have found the issue. Since your XML is confidential I will send you the details in mail but I have opened a more general defect on this, #48 . I will send you a possible workaround. |
I'm having some issues using the passport-saml library, which depends on xml-crypto, in a expressjs application running on a Windows server using the IISNode package. It is failing comparing the digest of an XML document during signature validation. It may not be xml-crypto but my own configuration, but I'm hoping you can take a look at this and tell me what might be going on. After some debugging, I've tried console logging the canonXML in validateReferences and I get this:
It prints out exactly like that in console. I know next to nothing about XML canonicalization. I'm concerned about the

after each line while other types of whitespace is retained, as I've never seen XML that looks like that.The text was updated successfully, but these errors were encountered: