code wiki / _hdl_build / nx_tlsprobe.nx

nx_tlsprobe.nx

buildroot/runtime/_hdl_build/nx_tlsprobe.nx

6649 B139 linesdepth 19pulls 117 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_sovjson_lib.nx nx_connect.nx nx_syscalls.nx nx_csprng.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_tlsprobe.nx

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

main sys_now_realtime_sec sys_mmap sys_clock_gettime_real 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 ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻

structs

none

consts

20const TP_MAGIC_8443: i64 = 8443
21const TP_MAGIC_4194304: i64 = 4194304
22const TP_MAGIC_4096: i64 = 4096
24const TP_CERTDATA: *u8 = "data/mozilla_certdata.txt" as *u8
25const TP_CERT_CAP: i64 = 16384
26const TP_LEDGER: *u8 = "knowledge/status/netobs_metrics.log"

functions

28func 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 }
called by 1: main calls 1: sys_write
29func 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 }
called by 1: main calls 2: sys_mmapsys_write
30func tp_cat(d: *u8, o: i64, s: *u8) -> i64 { return sj_cat(d, o, s) }
called by 1: tp_mrow calls 1: sj_cat
31func tp_catn(d: *u8, o: i64, v: i64) -> i64 { return sj_catn(d, o, v) }
called by 1: tp_mrow calls 1: sj_catn
32func tp_mrow(lb: *u8, o: i64, name: *u8, ts: i64, val: i64) -> i64
called by 1: main calls 3: tp_cattp_catnsys_now_us
44func tp_append(buf: *u8, n: i64) -> i64
55func tp_handshake(store: *TrustStore, host: *u8, host_len: i64, now: i64, vc: *TlsValidationContext) -> i64
87func main(argc: i64, argv: *i64) -> i64