Fix IPSAN and registeredID handling#10354
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR fixes name-constraint enforcement gaps by ensuring iPAddress and registeredID GeneralNames are always parsed/stored (even when their human-readable string helpers are disabled), and updates OpenSSL-compat APIs + tests accordingly.
Changes:
- Parse/store
iPAddressandregisteredIDSANs unconditionally soConfirmNameConstraintscan enforce permitted/excluded subtrees. - Extend name-constraint matching to include
registeredIDand ensure OpenSSL-compat SAN getters/printing remain safe when entries are raw bytes. - Add regression tests and new test CA artifacts for RID/IP name-constraint enforcement and hostname-check CN fallback behavior.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfcrypt/src/asn_orig.c | Always parses IP/RID altNames; gates only human-readable string generation behind feature macros. |
| wolfcrypt/src/asn.c | Adds RID enforcement to name-constraints logic; always decodes IP/RID GeneralNames into altNames. |
| src/x509.c | Makes OPENSSL_EXTRA SAN conversion handle RID unconditionally; avoids returning raw-byte altNames as C strings; improves printing behavior. |
| src/internal.c | Preserves CN-fallback semantics when only non-matchable altNames (IP without IP matching, RID) are present. |
| tests/api/test_certman.h | Registers new regression tests in the certman test group. |
| tests/api/test_certman.c | Adds regression tests for IP/RID name constraints, RID SAN exposure via OpenSSL APIs, and IP-only SAN CN fallback. |
| certs/test/include.am | Ships new RID name-constraints CA cert files. |
| certs/test/gen-ext-certs.sh | Adds generation stanza for the RID name-constraints CA cert. |
| certs/test/cert-ext-ncrid.pem | Adds the RID name-constraints CA certificate used by tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10354
Scan targets checked: wolfcrypt-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
|
@embhorn please resolve merge conflicts. Thanks |
244696b to
96c7af8
Compare
dgarske
left a comment
There was a problem hiding this comment.
I am concerned about asn.c bloat for customers who are size constrained. Is it possible some of these new checks could be wrapped with WOLFSSL_NO_ASN_STRICT for them?
Description
This PR fixes name-constraint enforcement gaps by ensuring iPAddress and registeredID GeneralNames are always parsed/stored.
Fixes zd21725
Testing
Added element to
ConfirmNameConstraintstest and certman tests.Checklist