Repository navigation
Add X509_STORE intermediates to the CertManager as chain CAs - #11917
Open
holtrop-wolfssl wants to merge 2 commits into
Open
holtrop-wolfssl wants to merge 2 commits into
holtrop-wolfssl wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the changes treating non-self-signed certificates in CTX-owned stores as chain CAs.
No open issues 🎉
What changed in this PR
This PR tightens certificate admission for CTX-owned X509 stores by treating non-self-signed certificates as chain CAs rather than permanent trust anchors.
Changes:
- Enforce CA and keyCertSign checks for intermediates added before or after store attachment, while preserving self-signed root handling.
- Add regression coverage for invalid intermediates, valid chain verification, and intermediate unloading.
| File | Description |
|---|---|
tests/api/test_ossl_x509_str.h |
Declares and registers the new regression test. |
tests/api/test_ossl_x509_str.c |
Tests certificate admission and intermediate unloading. |
src/x509_str.c |
Uses WOLFSSL_CHAIN_CA for non-self-signed store certificates. |
Review effort: Balanced
|
X509StorePushCertsToCM() and wolfSSL_X509_STORE_add_cert() on a CTX-owned store added non-self-signed certificates to the CertManager as WOLFSSL_USER_CA. AddCA() skips the CA:TRUE and keyCertSign admission checks for that type, so a CA:FALSE certificate, or a CA:TRUE certificate without keyCertSign, became a permanent trust anchor for anything signed by its key. Add them as WOLFSSL_CHAIN_CA instead so AddCA() enforces both checks and wolfSSL_CertManagerUnloadIntermediateCerts() can remove them. Self-signed roots are still added as WOLFSSL_USER_CA. ZD-22694 part A
holtrop-wolfssl
force-pushed
the
zd22694-a
branch
from
October 29, 2026 13:27
0604bb1 to
24c867c
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.
Description
X509StorePushCertsToCM() and wolfSSL_X509_STORE_add_cert() on a CTX-owned store added non-self-signed certificates to the CertManager as WOLFSSL_USER_CA. AddCA() skips the CA:TRUE and keyCertSign admission checks for that type, so a CA:FALSE certificate, or a CA:TRUE certificate without keyCertSign, became a permanent trust anchor for anything signed by its key.
Add them as WOLFSSL_CHAIN_CA instead so AddCA() enforces both checks and wolfSSL_CertManagerUnloadIntermediateCerts() can remove them. Self-signed roots are still added as WOLFSSL_USER_CA.
Fixes ZD#22694 part A
Testing
How did you test?
Checklist