UPSTREAM PR #30945: Fix CRL issuer lookup for partial chains#681
Open
loci-dev wants to merge 1 commit into
Open
UPSTREAM PR #30945: Fix CRL issuer lookup for partial chains#681loci-dev wants to merge 1 commit into
loci-dev wants to merge 1 commit into
Conversation
With X509_V_FLAG_PARTIAL_CHAIN, chain construction can stop at a trusted intermediate, leaving the issuer of that intermediate's CRL outside the built chain. Avoid treating the truncated chain anchor as the CRL issuer unless its subject matches the CRL issuer name, and for direct CRLs on the truncated anchor, look up the actual issuer from the trusted lookup source. Keep looked-up CRL issuer certificates alive for the store context and treat the verified direct issuer like the normal adjacent issuer case. Add regression coverage for PARTIAL_CHAIN with CRL_CHECK_ALL using RSA keys so it does not depend on EC support.
|
Base version dominated by lightweight 💬 Questions? Tag @loci-dev |
421b135 to
770bf14
Compare
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.


Note
Source pull request: openssl/openssl#30945
Fixes #30932
When
X509_V_FLAG_PARTIAL_CHAINis used withX509_V_FLAG_CRL_CHECK_ALL, chain construction can stop at a trusted intermediate. In that case, checking the trusted intermediate's revocation status may require a CRL whose issuer certificate is available from the trust store but is not present in the constructed chain.Previously, CRL issuer selection could accept the truncated chain anchor as the CRL issuer when the CRL had no AKID, because the adjacent-candidate path checked only the CRL AKID result. Since
X509_check_akid(cert, NULL)succeeds, this could select a certificate whose subject did not match the CRL issuer name. CRL signature verification was then attempted with the wrong public key, producing the misleading errorX509_V_ERR_CRL_SIGNATURE_FAILURE.This change:
check_issued(x, candidate)holds and the candidate matches the CRL issuer name and AKIDX509_STORE_CTXPARTIAL_CHAIN | CRL_CHECK | CRL_CHECK_ALLBackport status:
openssl-4.0: applies cleanlyopenssl-3.6: applies cleanlyopenssl-3.5: applies cleanlyopenssl-3.4: library changes apply cleanly. test/crltest.c needs a small manual conflict resolution due to test layout differences