Repository navigation
Conversation
Restore the cached path length from Basic Constraints when loading a CA from PEM, and propagate unlimited constraints to child CAs. Cover finite boundaries, unlimited chains, and the legacy missing-extension fallback.
AryanRG
marked this pull request as ready for review
October 16, 2026 23:40
AryanRG
marked this pull request as draft
October 16, 2026 23:49
This branch has not been deployed
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.
CA.from_pem()currently leaves the cached path length at the constructor default of 9. For example, importing a CA withpath_length=0lets it create a child even though the original CA refuses, producing a chain that exceeds the root’s constraint.Restore the cached limit from the imported certificate’s Basic Constraints and propagate
Nonewhen creating children of an unlimited CA. Preserve the existing default when the extension is absent. Add regressions for finite/unlimited limits and the absent-extension fallback; that fallback test checks compatibility, not certificate validity.Local validation on macOS / CPython 3.14.4:
type: ignoreontests/test_trustme.py:12, also reproduced on pristine base. Mypy passes with onlyunused-ignorediagnostics disabled.The multi-platform/Python matrix has not been run locally. Hosted CI results remain pending. Includes
newsfragments/727.bugfix.rst.