Skip to content
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

Fixed an obscure bug in which certificates may not be found. #104

Merged
merged 1 commit into from
Aug 5, 2015

Conversation

ethanmick
Copy link
Contributor

I did not write up a test case, but I did have to change this in my own implementation,
and it fixed the bug. If you'd like, I will attempt to write an actual test case.

This also more closely mimics the tests in xml-crypt, as shown here.

Not sure if anyone else has run into this issue, but I did in a separate project.
The issue is that when the signature node has been serialized to a String,
it loses the context of where it is in the XML tree. When deserialized, it
only knows about itself. Later in the code, in valdiateSignatureValue of xml-crypto,
this is called:

var signedInfo = utils.findChilds(this.signatureNode, "SignedInfo")

However, if the signature node has been serialized and deserialized, it
incorrectly reports it only has 1 child (itself), as opposed to the correct number.
This causes the certificate data to not be found, and the validation to fail.

All tests still pass with this change. Update to xml-crypto required.

Not sure if anyone else has run into this issue, but I did in a separate project.
The issue is that when the signature node has been serialized to a String,
it loses the context of where it is in the XML tree. When deserialized, it
only knows about itself. Later in the code, in valdiateSignatureValue of xml-crypto,
this is calleD:

However, if the signature node has been serialized and deserialized, it
incorrectly reports it only has 1 child (itself), as opposed to the correct number.
This causes the certificate data to not be found, and the validation to fail.

All tests still pass with this change. Update to xml-crypto required.
@ploer
Copy link
Contributor

ploer commented Aug 4, 2015

Nice catch, thanks. If you were able to construct a test case that exposes the bug and shows it fixed, that would be awesome.

I should be able to take a closer look and merge a little later this week.

@ploer
Copy link
Contributor

ploer commented Aug 5, 2015

Ah, looks like this is picking up the change from node-saml/xml-crypto#59, discussed in issue #94. Somehow I'd missed that that had gotten merged in xmlcrypto.

ploer added a commit that referenced this pull request Aug 5, 2015
Fixed an obscure bug in which certificates may not be found.
@ploer ploer merged commit 5c81b4d into node-saml:master Aug 5, 2015
@brianhartsock
Copy link
Contributor

@ploer awesome. how frequently do you cut additional NPM releases? Just wondering when to check back so I can use it vs. a git hash to depend on.

@ploer
Copy link
Contributor

ploer commented Aug 10, 2015

Was hoping to include PR #105, but looks like that's not quite ready, so will go ahead with a push tonight of what's in.

@brianhartsock
Copy link
Contributor

@ploer great, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants