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

Merge changes from datagovsg fork #161

Merged
merged 16 commits into from
Sep 10, 2018
Merged

Conversation

LoneRifle
Copy link
Collaborator

@LoneRifle LoneRifle commented Sep 6, 2018

This fork currently embodies fixes that addresses the following issues:

Fixes #113
Fixes #153
Fixes #158

Fixes #135

These are currently held in the datagovsg fork of xml-crypto, itself a fork of the Asana fork of the original.

I would also like to take the opportunity to request access to the repo so that I can merge changes, and access to the npm package so that I can cut releases for this library.

Hinaser and others added 15 commits June 8, 2018 17:48
Update Asana/xml-crypto with upstream changes
- removed an old (~5y ago) hack for windows store XML canonicalization
  (and removed the test)
- fixed an issue with over-eager prefix inclusion in non-exclusive
  c14n algorithm (+ test)
- replaced a test for empty-URI that is impossible to update (because
  the private key is missing)
…he output of transforms returns a node-set rather than an octet stream, which is whenever there are no transforms or the last transform is enveloped signature. Add back test for when canonicalization method is not specified in transforms
…tion

Fix default canonicalization

Summary:
According to the Digest Method Spec [1], the DigestMethod takes a octet stream, ad if the output of the URI dereference is a node set instead, it needs to be converted as described in the Reference Processing Spec [2] to an octet stream. The Reference Processing Spec says to use Canonical XML. Enveloped Signature returns a node-set, as does dereferencing a same-document reference [3], [4]. Canonicalization algorithms are the only other transforms we support, and they all return an octet stream, so the only times we need to add canonicalization are if we haven't done any transforms or if the last one is enveloped signature.

https://www.w3.org/TR/xmldsig-core1/#sec-DigestMethod
https://www.w3.org/TR/xmldsig-core1/#sec-ReferenceProcessingModel
https://www.w3.org/TR/xmldsig-core1/#sec-EnvelopedSignature
https://www.w3.org/TR/xmldsig-core1/#sec-Same-Document
Tests:
Added back the test from when this was implemented slightly differently for Windows Mobile, checked against a SamlResponse without a canonicalization method in the transforms

Reviewer: @srir
212200b changed the xpath to match all signature nodes descended from
the specified local node. This is incorrect; the relevant spec says that
only immediate signature elements should be removed

This commit corrects the behaviour simply by changing the xpath to only
match immediate children

Fixes node-saml#135 , where further discussion can be found
@yaronn
Copy link
Contributor

yaronn commented Sep 10, 2018

Hi, @LoneRifle added you as collaborator.

@LoneRifle
Copy link
Collaborator Author

I intend to make one more edit to package.json on our fork that will indicate a new release (0.10.2). Once I'm added as owner to the xml-crypto npm package, I'll publish a new release with all those changes, and tag the repo accordingly.

Thanks for having me look into this!

@yaronn
Copy link
Contributor

yaronn commented Sep 10, 2018

what's your npm username?

@LoneRifle
Copy link
Collaborator Author

LoneRifle commented Sep 10, 2018

it's lonerifle (all small-caps one word)

@yaronn
Copy link
Contributor

yaronn commented Sep 10, 2018

done! can you bump a major version before publishing? given the amount of changes seems safer. also there is a github notification on a vulnerable dependency in the current source (hapijs / hoek).

@LoneRifle
Copy link
Collaborator Author

Sure, will do! I'll look into the vuln, bumping the major release, and possibly #160

@yaronn
Copy link
Contributor

yaronn commented Sep 10, 2018

thanks, you do awesome work!

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