code wiki / _hdl_build / nx_tlsprobe.nx
nx_tlsprobe.nx
buildroot/runtime/_hdl_build/nx_tlsprobe.nx
about
nx_tlsprobe.nx -- TLS HANDSHAKE / CERTLOOP OBSERVABILITY PROBE (F834; the regression tooth for the F799
certloop cure). Does TWO real TLS 1.3 handshakes to the sovereign edge (loopback 127.0.0.1:8443, SNI +
cert-name = nishifamily.com) in one run:
1. COLD: fresh validation context, no cached cert -> full ECDSA chain walk (~certloop). cert_out captures
the presented Certificate message.
2. WARM: cached_cert = the cert captured in pass 1 -> the validator's fast path skips the chain crypto
(CertificateVerify possession proof STILL runs both times = MITM-safe by construction).
Emits BOTH whole-handshake wall times (ms) as METRIC rows into the netobs ledger, so /netobs shows the
cold vs warm handshake as a continuous series and the F799 saving can NEVER silently regress. A clock beat.
Rule 26: read-only network probe, zero hardware writes. Envelope: 2 handshakes/beat, loopback-only,
8s socket timeout, cert-capture <= 16 KiB. license_tier: ORIGINAL expect_exit: 0
dependencies 8 imports · 0 importers
imports: nx_sovjson_lib.nxnx_connect.nxnx_syscalls.nxnx_csprng.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.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
| 20 | const TP_MAGIC_8443: i64 = 8443 |
| 21 | const TP_MAGIC_4194304: i64 = 4194304 |
| 22 | const TP_MAGIC_4096: i64 = 4096 |
| 24 | const TP_CERTDATA: *u8 = "data/mozilla_certdata.txt" as *u8 |
| 25 | const TP_CERT_CAP: i64 = 16384 |
| 26 | const TP_LEDGER: *u8 = "knowledge/status/netobs_metrics.log" |
functions
| 28 | func tp_w(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 29 | func tp_wn(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 i: i64 = 0; while i < k { b[i] = t[k-1-i]; i = i + 1 } sys_write(1, b, k); return 0 } |
| 30 | func tp_cat(d: *u8, o: i64, s: *u8) -> i64 { return sj_cat(d, o, s) } |
| 31 | func tp_catn(d: *u8, o: i64, v: i64) -> i64 { return sj_catn(d, o, v) } |
| 32 | func tp_mrow(lb: *u8, o: i64, name: *u8, ts: i64, val: i64) -> i64 |
| 44 | func tp_append(buf: *u8, n: i64) -> i64 |
| 55 | func tp_handshake(store: *TrustStore, host: *u8, host_len: i64, now: i64, vc: *TlsValidationContext) -> i64 called by 1: main calls 8: sys_socketsys_set_socket_timeoutsys_mmapnx_connect_boundedsys_closenx_csprng_fill+2 |
| 87 | func main(argc: i64, argv: *i64) -> i64 |