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

support inclusive namespaces #48

Closed
yaronn opened this issue Apr 19, 2015 · 4 comments
Closed

support inclusive namespaces #48

yaronn opened this issue Apr 19, 2015 · 4 comments

Comments

@yaronn
Copy link
Contributor

yaronn commented Apr 19, 2015

Follow up to #43

A reference like this:

 <ds:Reference URI="...">
          <ds:Transforms>
            <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
              <xc14n:InclusiveNamespaces xmlns:xc14n="http://www.w3.org/2001/10/xml-exc-c14n#"  PrefixList="xs saml xsi">
              </xc14n:InclusiveNamespaces>
            </ds:Transform>
          </ds:Transforms>
          <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1">
          </ds:DigestMethod>
          <ds:DigestValue>...</ds:DigestValue>
    </ds:Reference>

means that we need to add definitions for xs, saml and xsi on the canonicalized value of the node we validate. they should be bound to whatever they are bound to in the context of that node.

for example if we need to sign X:

<y xmlns:xs="1" xmlns:saml="2" xmlns:xsi="3">
    <x>
</y>

then X canonical form should be:

<x xmlns:xs="1" xmlns:saml="2" xmlns:xsi="3"></x>
@chriswininger
Copy link

So I am experiencing the problem described #43 , the xml response from the server contains to following

 <ds:Reference URI="#Assertion-uuidf584541e-014e-17eb-a6cd-94807f7070de">
               <ds:Transforms>
                  <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                  <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
                     <xc14n:InclusiveNamespaces xmlns:xc14n="http://www.w3.org/2001/10/xml-exc-c14n#" PrefixList="xs saml xsi" />
                  </ds:Transform>
               </ds:Transforms>
               <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
               <ds:DigestValue>S5R/9vfMHCMHOZnFpwNvKEVMDgY=</ds:DigestValue>
            </ds:Reference>

You mention in #43 there is a possible workaround that you will e-mail the user. Could you possibly post that work around? Thanks in advance.

@yaronn
Copy link
Contributor Author

yaronn commented Aug 11, 2015

Hi

I have manually added to his SAML Assertion element the definitions of xmlns:saml, xmlns:xsi and xmlns:xs (which appeared elsewhere in the document). I believe he then went and automated the addition of those elements (just be careful not to change any white spaces.)
In terms of the defect above I have added the namespaces to X before verifying its signature. You should add the relevant namespaces to the element with id #Assertion-uuidf584541e-014e-17eb-a6cd-94807f7070de.

@chriswininger
Copy link

Ah, I see thanks. That did it.

@yaronn
Copy link
Contributor Author

yaronn commented Aug 11, 2015

great!

@yaronn yaronn closed this as completed Aug 11, 2015
@siacomuzzi siacomuzzi mentioned this issue Jan 28, 2016
johnhuangclever added a commit to Clever/saml2 that referenced this issue Jun 24, 2016
applies all inclusive namespaces for signature assertions onto assertion tag
used as recommended workaround for xml-crypto library limitation with inclusive namespaces see
node-saml/xml-crypto#48 (comment)
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

No branches or pull requests

2 participants