Repository navigation
tests: check ancestor name constraints on chains - #1395
ejohnstown wants to merge 1 commit into
Conversation
728b656 to
d2f0c87
Compare
A leaf below a peer-supplied subordinate CA must still meet the name constraints of the CAs above that CA. The test verifies a three-cert chain under a constrained root as both server and client. It needs wolfSSL 5.9.4 or later, but not cert generation. - keys/nc-*.der: constrained root, CA excluding a subtree, CA, 3 leaves; gen-nameconstraints.sh regenerates them, configure links them - leaf in the permitted subtree verifies; leaves outside it and in the excluded subtree are rejected, alone and within the chain - wolfSSL must reject each bad leaf with ASN_NAME_INVALID_E, so a broken fixture cannot pass as a rejection - add WOLFSSL_V5_9_4 to internal.h Issue: F-13950
d2f0c87 to
ce3e53b
Compare
|
@claude review |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #1395
Scan targets checked: wolfssh-src, wolfssh-bugs
Not reviewed (no scan target covers them): configure.ac, keys/gen-nameconstraints.sh, keys/include.am, keys/nc-ca-a.der, keys/nc-ca-b.der, keys/nc-leaf-excl.der, keys/nc-leaf-in.der, keys/nc-leaf-out.der, keys/nc-root.der
Coverage: 2 of 2 in-scope changed file(s) opened by the reviewer
Fenrir result: Approved ✅
No new issues found in the changed files.
Advisory only — this automated result does not count as a GitHub approval.
Review tier: Max
There was a problem hiding this comment.
LGTM. This is a test-only regression change, and it doesn't touch any wolfSSH library code.
What was reviewed:
- The new WOLFSSH_TEST_CERTMAN_NAMECONSTRAINTS guard. LIBWOLFSSL_VERSION_HEX and WOLFSSL_V5_9_4 are both defined by the time the guard is reached. Moving certmanPutU32, certmanAppendCert and CERTMAN_LEAF_USAGE_OK into the shared PROMOTE||NAMECONSTRAINTS block doesn't leave any duplicate definitions or unused-function gaps.
- certmanNameConstraintsCase. Its cleanup paths and chain-buffer bounds look right (the chain is under 1.5 KB against a 4096-byte buffer). The lone-leaf pass relies on the intermediates that the 3-cert pass stores in the manager.
- The six nc-*.der fixtures are registered in both configure.ac AC_CONFIG_LINKS and keys/include.am EXTRA_DIST. I could not open the DER contents here, so I haven't checked them against gen-nameconstraints.sh. The test's own wolfSSL ASN_NAME_INVALID_E check covers this when it runs.
Extended reasoning...
The change adds a unit test in tests/unit.c, six ECDSA P-256 DER fixtures, an openssl script to regenerate them, build wiring in configure.ac and keys/include.am, and one version constant in wolfssh/internal.h. It exercises certificate chain verification, which is security-sensitive, but it doesn't change any verification code. It only adds coverage behind a wolfSSL >= 5.9.4 guard. The helper moves are mechanical and match the existing guard conventions. No CODEOWNERS file covers these paths, and the timeline shows no outstanding reviewer objections.
A leaf below a peer-supplied subordinate CA must still meet the name
constraints of the CAs above it. wolfSSL enforces this from 5.9.4, and
this adds a regression test for it that needs no cert generation.
script to regenerate them; configure links them for VPATH builds
leaves fail, alone and in the chain, and wolfSSL itself must reject
them with ASN_NAME_INVALID_E
Issue: F-13950