code wiki / (root) / nx_trust_store_load_from_certdata_e2e_test.nx

nx_trust_store_load_from_certdata_e2e_test.nx

buildroot/runtime/nx_trust_store_load_from_certdata_e2e_test.nx

10252 B250 linesdepth 7pulls 9 transitivereach 0 importersview sourcekind gate/prooftopic trust
docsdependenciesstructsconstsfunctions

about

nx_trust_store_load_from_certdata_e2e_test.nx -- REAL END-TO-END happy-path KAT for the boot-time loader. Unlike the verdict-only sibling test, this one exercises the FULL composed pipeline against a real on-disk file: 1. Build a real 169-byte minimal Ed25519 v1 DER cert in memory 2. Wrap it in Mozilla NSS certdata.txt PKCS#11 text format with proper \NNN multiline-octal escape encoding of the DER 3. Write the certdata.txt content to a real temp file via sys_openat_wr + sys_write 4. Call nx_trust_store_load_from_certdata against the path 5. Verify the returned *TrustStore has the cert populated Stands as evidence against [[feedback-no-false-ok-substrate- honesty-audit]] -- the verdict-only smoke shipped earlier only hit error paths and could not have detected a bug in the happy- path composition. This test would catch a bug ANYWHERE in: sys_read_file -> nx_nss_certdata_parse (octal escape decoder, state machine) -> trust_store_alloc -> nx_x509_trust_store_load (wire-format walker + x509_parse + trust_store_add) expect_exit: 0 license_tier: ORIGINAL

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_x509.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_trust_store_load_from_certd

imports: nx_syscalls.nxnx_x509.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.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_v1_cert emit_ed25519_algid emit_utctime emit_bytes emit_octal_escape emit_u8 sys_openat_wr sys_write sys_close nx_trust_store_load_from_c sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻ nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻

structs

none

consts

none

functions

35func emit_ed25519_algid(buf: *u8, off: i64) -> i64
called by 1: build_min_v1_cert
46func emit_utctime(buf: *u8, off: i64,
called by 1: build_min_v1_cert
68func build_min_v1_cert(buf: *u8, off: i64, serial_byte: i64) -> i64
called by 1: main calls 2: emit_ed25519_algidemit_utctime
113func emit_bytes(buf: *u8, off: i64, src: *u8, n: i64) -> i64
called by 1: main
125func emit_octal_escape(buf: *u8, off: i64, b: i64) -> i64
called by 1: main
137func emit_u8(buf: *u8, off: i64, b: i64) -> i64
called by 1: main
142func main() -> i64