fix: support multiple X509Certificate elements in X509Data#1022
Open
nicoske wants to merge 1 commit intoIdentityPython:masterfrom
Open
fix: support multiple X509Certificate elements in X509Data#1022nicoske wants to merge 1 commit intoIdentityPython:masterfrom
nicoske wants to merge 1 commit intoIdentityPython:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The feature or problem addressed by this PR
X509DataType_definesx509_certificatewith a max cardinality of 1. When an IdP publishes certificate chains in its metadata (signing cert + CA cert in the same<X509Data>block), the second<X509Certificate>overwrites the first during deserialization. pysaml2 ends up with only the CA certificate and loses the actual signing certificate, causingSignatureError: Failed to verify signature.Closes #731
What your changes do and why you chose this solution
Changed
x509_certificatefrom a scalar field to a list field inX509DataType_, following the existing pattern used byKeyInfoType_forx509_data,key_name, etc. This aligns withxmldsig-core-schema.xsdwhereX509DataTypeis a sequence withmaxOccurs="unbounded".Updated all consumers in
mdstore.py,sigver.py,metadata.pyands2repoze/plugins/sp.pyto iterate over the list.Checklist