Harden PKIX path validation and support trusted certificate PEM blocks - #206
Merged
Merged
Conversation
Path validation and building: - Restrict CRL-signer validation to the supplied trust anchors and report the real failure per RFC 5280 sec. 6.3.3 (f); when the distribution-point CRLs are tried first and fail, chain that context into the message. - Count path length excluding self-issued intermediates so a rolled root or an indirect CRL-signer chain is bounded correctly. - Narrow the active parameters to the resolved trust anchor during validation, and raise when the resolved anchor is not among those supplied. - Honour excluded certificates when building, and raise a recoverable error when no CRLs are found instead of looping on a shared issuer DN. - Find the trust anchor by comparing the CA and subject by value, preserving the first failure reason. Trust anchor and KEK: - Compare the trust-anchor CA by value and drop the string CA-name form; callers and results use CA.ToString(). - Include the optional entityUInfo in the ECDH KEK shared info. OpenSSL PEM: - Read and write TRUSTED CERTIFICATE blocks (X509 trusted certificate block and certificate trust block). Tests: - Add CertPathHardeningTests covering the shared-CRL-issuer loop case and the indirect CRL-signer paths (single generation, rolled root, excluded signer, and path-length bounds). - Add OpenSSL trusted-certificate round-trip and an EdDSA private-key read, loading the key from the test data folder. - Assert the trust-anchor CA round-trips via CA.ToString().
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.
Summary
Hardens certification path validation and building, and adds read/write support
for TRUSTED CERTIFICATE PEM blocks. Also tightens a few related surfaces
(trust-anchor comparison, ECDH KEK shared info).
Path validation and building
real failure per RFC 5280 sec. 6.3.3 (f). When the certificate's own
distribution-point CRLs are tried first and fail, that context is chained into
the final message instead of being lost.
indirect CRL-signer chain is bounded correctly.
and raise when the resolved anchor is not among those supplied.
CAs share a CRL-issuer distinguished name.
first failure reason.
Trust anchor and ECDH KEK
and results now use
CA.ToString().OpenSSL PEM
wrapping the certificate plus an optional certificate trust block).
Tests
CertPathHardeningTestscovering the shared-CRL-issuer loop case and theindirect CRL-signer paths (single generation, rolled root, excluded signer,
and maximum-path-length bounds).
loading the key from the test data folder.
CA.ToString().