Skip to content

Implement EncryptedKey RetrievalMethod support#297

Merged
pitbulk merged 2 commits into
SAML-Toolkits:masterfrom
flant:key_info_retrieval_method
Apr 1, 2016
Merged

Implement EncryptedKey RetrievalMethod support#297
pitbulk merged 2 commits into
SAML-Toolkits:masterfrom
flant:key_info_retrieval_method

Conversation

@dmgtn

@dmgtn dmgtn commented Jan 13, 2016

Copy link
Copy Markdown
Contributor

Implemented support for EncryptedKey RetrievalMethod.

Example

  <saml2:EncryptedAssertion xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">
    <xenc:EncryptedData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_073b6815e847fee92645b4555c09cf6c" Type="http://www.w3.org/2001/04/xmlenc#Element">
      <xenc:EncryptionMethod xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/>
      <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:RetrievalMethod Type="http://www.w3.org/2001/04/xmlenc#EncryptedKey" URI="#_8086c3e85abfdda1e308f3b255abe5dc"/>
      </ds:KeyInfo>
      <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
        <xenc:CipherValue>xxx</xenc:CipherValue>
      </xenc:CipherData>
    </xenc:EncryptedData>
    <xenc:EncryptedKey xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Id="_8086c3e85abfdda1e308f3b255abe5dc">
      <xenc:EncryptionMethod xmlns:xenc="http://www.w3.org/2001/04/xmlenc#" Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p">
        <ds:DigestMethod xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
      </xenc:EncryptionMethod>
      <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
        <ds:X509Data>
          <ds:X509Certificate>xxxx</ds:X509Certificate>
        </ds:X509Data>
      </ds:KeyInfo>
      <xenc:CipherData xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
        <xenc:CipherValue>xxx</xenc:CipherValue>
      </xenc:CipherData>
    </xenc:EncryptedKey>
  </saml2:EncryptedAssertion>

@mchaisse

mchaisse commented Mar 2, 2016

Copy link
Copy Markdown

I have a client using this same different format. @pitbulk can you please consider this PR? :)

@dmgtn

dmgtn commented Mar 3, 2016

Copy link
Copy Markdown
Contributor Author

Okta uses this format when assertions encryption is enabled. This PR is fully backward compatible and should not break anything!

@pitbulk

pitbulk commented Mar 3, 2016

Copy link
Copy Markdown
Collaborator

Can you provide specific unit test for that?
I think we can merge this change after that.

@mchaisse

mchaisse commented Mar 8, 2016

Copy link
Copy Markdown

@Distol do you have any example we can use for the tests? If not I can probably find some. If you don't have time, no problem, I can probably open another PR with the proper tests :)

@dmgtn

dmgtn commented Mar 8, 2016

Copy link
Copy Markdown
Contributor Author

Give me a couple of days and I'll do it.

@Seraff

Seraff commented Mar 15, 2016

Copy link
Copy Markdown
Contributor

@pitbulk, I added a test for RetrievalMethod support. It is similar to "it is possible to decrypt the assertion if private key", but uses another XML response. Is it ok?

@pitbulk

pitbulk commented Mar 15, 2016

Copy link
Copy Markdown
Collaborator

Thanks for the contribution guys, I will review if there is any security issue related to this change and I will share with the rest to the team.

I hope to merge it as soon as possible.

@pitbulk
pitbulk merged commit 0ab6613 into SAML-Toolkits:master Apr 1, 2016
@Seraff
Seraff deleted the key_info_retrieval_method branch April 1, 2016 15:16
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.

4 participants