code wiki / (root) / nx_x509_chain_cache_gate.nx

nx_x509_chain_cache_gate.nx

buildroot/runtime/nx_x509_chain_cache_gate.nx

2725 B34 linesdepth 14pulls 67 transitivereach 0 importersview sourcekind gate/prooftopic x509
docsdependenciesstructsconstsfunctions

about

nx_x509_chain_cache_gate.nx -- durable regression witness for the cert-validation MEMOIZATION cache (nx_x509_chain_verify: _cv_der_len + _cv_key_eq). The cache memoizes the PURE verify on sha256(child_der||parent_der); a bug in _cv_der_len (wrong cert length -> key over wrong bytes) would risk a false cache hit, and a bug in _cv_key_eq (loose 32-byte compare) would risk a cross-cert hit -- so both are KAT-locked here. The live badssl gate (self-signed/expired/wrong-host rejected) covers end-to-end; this locks the correctness-critical helpers so a future edit can't silently regress them. license_tier: ORIGINAL expect_exit:0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_x509_chain_verify.nx nx_x509_chain_cache_gate.nx

imports: nx_syscalls.nxnx_x509_chain_verify.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 chk gcw sys_write gpn gcw ↻ sys_mmap ↻ sys_write ↻ _cv_der_len _cv_key_eq gcw ↻ sys_exit gpn ↻

structs

none

consts

none

functions

10func gcw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: gpnchkmain calls 1: sys_write
11func gpn(v: i64) -> i64 { var m: i64=v; if m==0 { gcw("0" as *u8); return 0 } let t: *u8=sys_mmap(24); var k: i64=0; while m>0 { t[k]=(48+(m%10)) as u8; m=m/10; k=k+1 } let o: *u8=sys_mmap(24); var i: i64=0; while i<k { o[i]=t[k-1-i]; i=i+1 } sys_write(1,o,k); return 0 }
called by 2: chkmain calls 3: gcwsys_mmapsys_write
12func chk(name: *u8, got: i64, want: i64, f: *i64) -> i64
called by 1: main calls 2: gcwgpn
17func main() -> i64