Repository navigation
Keep CA temporary when the verify callback waives a held CRL error - #12115
Closed
padelsbach wants to merge 11 commits into
Closed
padelsbach wants to merge 11 commits into
padelsbach wants to merge 11 commits into
Conversation
When an application's verify callback accepted a chain wolfSSL had rejected, any CA in that chain was added to the WOLFSSL_CTX certificate manager. This meant later connections trusted that same CA as well. This change makes it so that these CAs are added to a list owned by the Certificate message and reach ParseCertRelative() via its extraCa argument.
- A chain could become longer than the waived CA's path length; the limit was being lost and silently replaced with the maximum - A hash used to authorize delegated OCSP responders was left blank on waived CAs - OCSP responses signed by a waived CA no longer fail to verify - The callback is no longer asked again for every cert below a waived CA in WOLFSSL_SMALL_CERT_VERIFY builds - Unknown-extension callback is now called on waived CAs with an unknown critical extension - Changed waived CA list lifetime to last for the whole connection rather than the Certificate message, so it's still there when a stapled OCSP status arrives
The lookup that searches an OCSP responder's extra signer list was compiled only when OCSP stapling v2 was enabled, while it's now needed for the certs accepted via the verify callback.
|
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Temporary CA waivers persist across subsequent Certificate messages, allowing later chains to reuse trust exceptions that the verification callback no longer accepts.
3 open issues
What changed in this PR
This follows #11110 by keeping chain CAs temporary when a verification callback waives a held CRL error, rather than adding them to the shared certificate manager.
Changes:
- Tracks callback-accepted CAs separately, including descendants whose verification depends on them.
- Makes temporary signers available to certificate and OCSP verification.
- Adds regression tests for CA non-persistence and waived CRL errors.
| File | Description |
|---|---|
wolfssl/wolfcrypt/asn.h |
Declares parsing with additional signers. |
wolfssl/ssl.h |
Clarifies the temporary-CA scope comment. |
wolfssl/internal.h |
Adds waived-CA storage and helper declarations. |
wolfcrypt/src/asn.c |
Extends certificate and OCSP signer lookup. |
tests/api/test_ocsp.c |
Tests non-persistence after a CRL-error waiver. |
tests/api.c |
Tests non-persistence of callback-accepted CA chains. |
src/ssl.c |
Clears waived CAs when resetting a connection. |
src/ocsp.c |
Includes waived CAs during OCSP response verification. |
src/internal.c |
Implements temporary-CA handling and cleanup. |
Review effort: Balanced
| } | ||
| #endif | ||
| /* Parse Certificate */ | ||
| extraSigners = SslWaivedCAsJoin(ssl, extraSigners, &waivedTail); |
Comment on lines
+17950
to
+17951
| if (SSL_CM(ssl)->unknownExtCallback != NULL) | ||
| wc_SetUnknownExtCallback(dCertAdd, SSL_CM(ssl)->unknownExtCallback); |
Comment on lines
+20747
to
+20748
| if (caIsTemp) { | ||
| ret = ProcessPeerCertAddWaivedCA(ssl, cert); |
padelsbach
force-pushed
the
ca-trust-held-crl
branch
from
November 12, 2026 21:20
b93dede to
17bdaff
Compare
padelsbach
marked this pull request as draft
November 12, 2026 21:21
Contributor
Author
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
Follow up to #11110, please merge that first. Address the case where the CRL error was cleared by the callback but the CA is still added to the store.
Testing
Added unit test
Checklist