code wiki / _hdl_build / nx_x509_verify_rsa_gate.nx
nx_x509_verify_rsa_gate.nx
buildroot/runtime/_hdl_build/nx_x509_verify_rsa_gate.nx
about
nx_x509_verify_rsa_gate.nx -- DIRECT gate for the x509 RSA-verify family (flagged by the HONESTY SYSTEM
2026-07-16: nx_x509_verify_rsa_pkcs1_sha256 + nx_x509_pubkey_extract_rsa, reach ~479, no DIRECT test edge).
A crypto-verify gate CANNOT be fake-greened: it passes only if every DER offset, the issuer-key extraction,
and the RSA signature are ALL correct (unlike marker judges). Composition over REAL persistent certs:
parse real_leaf.der -> parse the intermediate out of real_fullchain.der -> extract issuer RSA (n,e) ->
verify the leaf's TBS signature under the issuer key -> must be OK ; then corrupt one sig byte -> must FAIL.
Wrapper-logic tests (verdict validator + sig_len!=256 rejection) hold regardless of the leaf's algorithm.
Rich diagnostics: prints parse rc, tbs/sig lens, and the leaf sig-alg OID so a RED is INFORMATIVE, not opaque.
license_tier: ORIGINAL expect_exit:0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_x509.nxnx_x509_pubkey_rsa.nxnx_x509_verify_rsa_pkcs1_sha256.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
| 15 | func xw(s: *u8) -> i64 { var n:i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | func xn(v: i64) -> i64 { let b:*u8=sys_mmap(24); var m:i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var j:i64=0; while j<k{b[j]=t[k-1-j];j=j+1} sys_write(1,b,k); return 0 } |
| 17 | func xhex(buf: *u8, off: i64, len: i64) -> i64 |
| 30 | func rdfile(path: *u8, lenout: *i64) -> *u8 |
| 38 | func main() -> i64 |