Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Fix default canonicalization #4

Merged
merged 1 commit into from
Aug 8, 2018

Conversation

meganmd
Copy link

@meganmd meganmd commented Aug 8, 2018

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.

  1. https://www.w3.org/TR/xmldsig-core1/#sec-DigestMethod
  2. https://www.w3.org/TR/xmldsig-core1/#sec-ReferenceProcessingModel
  3. https://www.w3.org/TR/xmldsig-core1/#sec-EnvelopedSignature
  4. 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

…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
@meganmd meganmd requested a review from srir August 8, 2018 18:56
Copy link

@srir srir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thanks for documenting thoroughly

@meganmd meganmd merged commit bcccb80 into master Aug 8, 2018
@meganmd meganmd deleted the megandaly-fix-auto-canonicalization branch August 8, 2018 19:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants