code wiki / _hdl_build / nx_tls12_frag_read_gate.nx
nx_tls12_frag_read_gate.nx
buildroot/runtime/_hdl_build/nx_tls12_frag_read_gate.nx
about
nx_tls12_frag_read_gate.nx -- DETERMINISTIC partial-read proof for the
TLS 1.2 record reader + ServerHello parser.
The intermittent "cipher reads 0xC02B instead of 0xC02F" garble was
hypothesised to be an INCOMPLETE record read: the 5-byte header says
length N but fewer bytes have arrived, so tls12_parse_server_hello runs
on a short/shifted buffer. A live host (WSL2/CDN) often delivers the
whole flight in one big segment, so the partial-read code path is never
exercised live. This gate forces MAXIMAL fragmentation deterministically:
a forked child writes a known-good ServerHello record ONE BYTE AT A TIME
down a pipe; the parent reads it back through nx_tls13_read_record_from_fd
(the exact framer the 1.2 session uses) and parses the cipher.
If the record reader truly loops to completion, the reassembled cipher
MUST be 0xC02F under any fragmentation. A short-buffer parse would yield
a garbled value -> RED. This proves (or refutes) the read mechanism.
expect_exit: 0
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_tls12_parse.nxnx_tls13_read_record_from_fd.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
| 25 | func fg_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 26 | func fg_n(v: i64) -> i64 |
| 36 | func fg_row(id: *u8, ok: i64, pass: *i64, total: *i64) -> i64 |
| 48 | func fg_build_sh(out: *u8, chi: i64, clo: i64) -> i64 called by 1: main |
| 66 | func fg_read_and_parse(rfd: i64) -> i64 |
| 83 | func fg_scenario(rec: *u8, n: i64, chunk: i64, ms: i64) -> i64 |
| 117 | func main() -> i64 |