code wiki / (root) / nx_https_pipeline_e2e_test.nx

nx_https_pipeline_e2e_test.nx

buildroot/runtime/nx_https_pipeline_e2e_test.nx

14861 B366 linesdepth 15pulls 75 transitivereach 0 importersview sourcekind gate/prooftopic https
docsdependenciesstructsconstsfunctions

about

nx_https_pipeline_e2e_test.nx -- THE end-to-end happy-path KAT for the full bits-up HTTPS cert verification pipeline. Closes the verification loop: this single test exercises every substrate primitive shipped this session for the public-HTTPS arc, from raw TLS 1.3 Certificate message bytes to a verdict. Flow: 1. Build a TrustStore + add the root cert as an anchor 2. Build a TLS 1.3 Certificate message wrapping a real DER leaf cert (built inline via build_min_cert below) 3. Call nx_https_cert_pipeline_verify_with_store(...) 4. Verify the returned verdict is NX_HTTPS_PIPELINE_OK Test vector setup: - Leaf cert: minimal-but-real DER cert from leaf_check_test (commit 50d861a8) with validity [2023..2026] + SAN "example.com" + Ed25519 SPKI (not exercised here -- root doesn't try to verify leaf's sig; we set sig_alg to Ed25519 to match) - Root cert: synthetic root with subject DN "CN=Root" - For ECDSA-style verify we'd need a real CA-signed cert which requires either a private CA key (we don't have signing) or a real-world cert vector. The RFC 6979 vector lets us do "sig over 'sample'" but not "sig over a real cert's tbs". So this KAT covers the EARLY-EXIT flow: build a real DER leaf whose tbs is well-formed but whose outer sig is garbage Ed25519 bytes. Pipeline gets to: - parse Cert message OK - parse leaf DER OK - leaf_check OK (validity + SAN both pass) - chain_verify -> verify_under_issuer dispatches by leaf's sig_alg (Ed25519) -> calls x509_verify_signature_ed25519 -> the underlying ed25519 verify is known broken (task #23) -> returns SIG_FAIL Expected end verdict: NX_HTTPS_PIPELINE_CHAIN_SIG_FAIL This KAT proves the full pipeline ROUTES correctly end-to-end: every sub-primitive is reached, every dispatch is exercised,

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_u256.nx nx_x509.nx nx_x509_trust_store.nx nx_https_cert_pipeline.nx nx_https_pipeline_e2e_test.nx

imports: nx_syscalls.nxnx_u256.nxnx_x509.nxnx_x509_trust_store.nxnx_https_cert_pipeline.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap build_min_cert_root_subjec emit_ed25519_algid write_root_dn emit_utctime emit_dnsname build_synthetic_root emit_ed25519_algid ↻ write_root_dn ↻ zero_cert trust_store_alloc sys_mmap ↻ trust_store_add trust_store_count nx_https_cert_pipeline_ver sys_mmap ↻ tls13_parse_certificate_ch tls13_auth_check_handshake tls_read_u16_be x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id sys_mmap ↻ asn1_expect_tag ↻ trust_store_lookup_by_subj nx_x509_dn_match _pipeline_verify_n sys_mmap ↻ tls13_parse_certificate_ch ↻

structs

none

consts

none

functions

55func emit_utctime(buf: *u8, off: i64,
77func emit_ed25519_algid(buf: *u8, off: i64) -> i64
88func emit_dnsname(buf: *u8, off: i64, name: *u8, name_len: i64) -> i64
100func write_root_dn(buf: *u8, off: i64) -> i64
111func zero_cert(cert: *X509Cert) -> i64
150func build_min_cert_root_subject(buf: *u8, host: *u8, host_len: i64) -> i64
251func build_synthetic_root(buf: *u8, cert: *X509Cert) -> i64
267func main() -> i64