Skip to content

Don't send keys in SP Metadata file that you don't want the IdP to use#117

Closed
waynewoodfield wants to merge 3 commits into
SAML-Toolkits:masterfrom
waynewoodfield:conditional-certs
Closed

Don't send keys in SP Metadata file that you don't want the IdP to use#117
waynewoodfield wants to merge 3 commits into
SAML-Toolkits:masterfrom
waynewoodfield:conditional-certs

Conversation

@waynewoodfield

Copy link
Copy Markdown

Don't send the encryption key if you don't want assertions encrypted. Don't send the signing key if you aren't going to sign your authnrequests. The IdP will see these as indicators that you want the keys to be used (especially the encrypted assertions).

… Don't send the signing key if you aren't going to sign your authnrequests. The IdP will see these as indicators that you want the keys to be used (especially the encrypted assertions).
@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 95.138% when pulling 1980b19 on waynewoodfield:conditional-certs into 9274e6b on onelogin:master.

keyDescriptorXml.append("</ds:X509Data>");
keyDescriptorXml.append("</ds:KeyInfo>");
keyDescriptorXml.append("</md:KeyDescriptor>");
if (settings.getAuthnRequestsSigned()) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what about LogoutRequest/LogoutResponse signing?

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 95.138% when pulling 8e2f124 on waynewoodfield:conditional-certs into 9274e6b on onelogin:master.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.006%) to 95.138% when pulling c04427c on waynewoodfield:conditional-certs into 9274e6b on onelogin:master.

@waynewoodfield

Copy link
Copy Markdown
Author

Thanks for the call-out. We haven't implemented the SLO yet at my company, so I had a blind spot to that. Added them into the condition now.

I don't actually care whether we send the signing key all the time or not. The encryption key is the one I mostly cared about, because there's no "wantResponsesEncrypted" property in the SP Metadata, so the only way I know to tell the IdP that I don't want SAMLResponses to be encrypted is to not send an encryption key.

@pitbulk

pitbulk commented Jul 17, 2017

Copy link
Copy Markdown
Contributor

I agree that the encryption part is the most important.

Can you add some unit test as well?

@pitbulk

pitbulk commented Jul 22, 2017

Copy link
Copy Markdown
Contributor

I also noticed that if getWantNameIdEncrypted is true, encryption key should be also sent.

Avoid key signing publication is weird for me.

I will follow the approach we did on php-saml:
https://github.com/onelogin/php-saml/blob/master/lib/Saml2/Metadata.php#L199

@waynewoodfield

Copy link
Copy Markdown
Author

I've updated this fork to include recommendations by Sixto - the signing key is published unconditionally, and encryption key will still be sent when getWantNameIdEncrypted is true. If you'd like to use that fork, I can resubmit a pull request. Otherwise, looking forward to your fix.

pitbulk added a commit that referenced this pull request Jul 23, 2017
@pitbulk

pitbulk commented Jul 23, 2017

Copy link
Copy Markdown
Contributor

Hi @waynewoodfield, I followed what I did on php-saml, adding a boolean to decide when to encrypt or not instead of sending the full settings object. This way we keep the back-compatibility.

Thanks for contribute!

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