nx_x509_leaf_check_test.nx
buildroot/runtime/nx_x509_leaf_check_test.nx
about
nx_x509_leaf_check_test.nx -- orchestrator verdict-mapping KAT.
We do NOT round-trip through x509_parse here (the parser has its
own existing coverage via nx_x509_validate and the SAN+validity
smokes). Instead we exercise the orchestrator's dispatch logic
directly by manually constructing X509Cert struct contents +
the byte buffers the sub-primitives walk, then calling
x509_leaf_check via a structural fast-path.
Specifically we test the cases that x509_leaf_check can encounter
in production once chained behind x509_parse on a real DER cert:
- all checks pass -> NX_X509_LEAF_OK
- parse failure (DER too short / corrupt) -> PARSE_FAIL
- notBefore in future -> NOT_YET_VALID
- notAfter in past -> EXPIRED
- SAN missing -> NO_SAN
- SAN present, hostname not covered -> HOSTNAME_MISMATCH
- bad SAN format -> BAD_FORMAT
- bad SAN pattern -> BAD_PATTERN
- sealed verdict gate
Note: x509_leaf_check internally calls x509_parse, but for the
OK / SAN-mismatch / etc. cases we need a real DER cert. We build
a minimal-but-real one inline.
expect_exit: 0
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_x509.nxnx_x509_validity.nxnx_x509_san.nxnx_x509_leaf_check.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 38 | func emit_utctime(buf: *u8, off: i64, called by 1: build_min_cert |
| 62 | func emit_ed25519_algid(buf: *u8, off: i64) -> i64 called by 1: build_min_cert |
| 74 | func emit_dnsname(buf: *u8, off: i64, name: *u8, name_len: i64) -> i64 called by 1: build_min_cert |
| 128 | func build_min_cert(buf: *u8, host: *u8, host_len: i64) -> i64 |
| 234 | func main() -> i64 |