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

Change HashSet to LinkedHashSet for RelyingPartyRegistration credentials #10912

Conversation

fhanik
Copy link
Contributor

@fhanik fhanik commented Feb 25, 2022

Changing the collections type in the RelyingPartyRegistration.Builder to LinkedHashSet from HashSet

RelyingPartyRegistration constructor converts the credentials (credentials, decryptionX509Credentials, signingX509Credentials) to unmodifiable, ordered LinkedList objects.

There is a chance, possibly minuscule but not non existent, that the Builder collections which uses HashSet/HashMap underneath may return a different order for these credentials. This may lead to very difficult debugging steps when a certain key (the first in the list) is expected to have been used for signing but wasn't.

@fhanik
Copy link
Contributor Author

fhanik commented Feb 25, 2022

Would love to have this simple fix back ported to maintenance branches too. Thank you!

@jzheaux
Copy link
Contributor

jzheaux commented Feb 28, 2022

Thanks, @fhanik! This is merged into 5.7.x via 70b52a0. It will also be ported to main, 5.6.x, and 5.5.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: saml2 An issue in SAML2 modules type: bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants