code wiki / _hdl_build / nx_uiq_wire_lib.nx
nx_uiq_wire_lib.nx
buildroot/runtime/_hdl_build/nx_uiq_wire_lib.nx
about
nx_uiq_wire_lib.nx -- FROM THE FIRST BYTE UP: the wire/response layer of experiential testing.
Every other uiq organ starts at the HTML source or the rendered pixels; this one starts at BYTE 0 of
the HTTP response -- the status line + headers the edge emits BEFORE any body. Audits the SOTA
security/quality header posture (OWASP Secure Headers / web.dev): Content-Type(+charset),
X-Content-Type-Options:nosniff, X-Frame-Options|CSP frame-ancestors (clickjacking),
Content-Security-Policy (the defense-in-depth that neutralises stored injection BEFORE escaping),
Referrer-Policy, Strict-Transport-Security (HSTS). Parses a captured raw response (status line +
headers up to the blank line); the fetch is the already-sovereign nx_https_get (compose, don't rebuild).
HONEST ENVELOPE (in output): header PRESENCE + a coarse CSP-strength read; it does NOT execute the CSP
or prove the policy is tight -- presence is the floor, not proof. license_tier: ORIGINAL genealogy: experiential wire layer
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_itoa_lib.nx
imported by: nx_uiq_wire.nxnx_uiq_wire_gate.nx
structs
| none |
consts
| 13 | const UW_MAGIC_1024: i64 = 1024 |
| 14 | const UW_MAGIC_8192: i64 = 8192 |
| 15 | const UW_MAGIC_8191: i64 = 8191 |
| 16 | const UW_MAGIC_4096: i64 = 4096 |
| 17 | const UW_MAGIC_4095: i64 = 4095 |
| 19 | const UW_SEC_TOTAL: i64 = 5 // the 5 scored security headers |
functions
| 21 | func uw_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 uw_pn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 27 | func uw_cat(d: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; var o: i64=off; while s[i]!=(0 as u8){d[o]=s[i]; o=o+1; i=i+1} return o } called by 1: uw_emit |
| 28 | func uw_catn(d: *u8, off: i64, v: i64) -> i64 |
| 33 | func uw_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 34 | func uw_lc(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c } |
| 37 | func uw_hdr_end(buf: *u8, n: i64) -> i64 called by 1: uw_audit |
| 46 | func uw_has(buf: *u8, hn: i64, name: *u8) -> i64 |
| 64 | func uw_val_has(buf: *u8, hn: i64, name: *u8, needle: *u8) -> i64 |
| 92 | func uw_status(buf: *u8, n: i64) -> i64 called by 1: uw_audit |
| 99 | func uw_audit(buf: *u8, n: i64, out: *i64) -> i64 |
| 114 | func uw_slurp(path: *u8, buf: *u8, cap: i64) -> i64 |
| 124 | func uw_emit(label: *u8, out: *i64) -> i64 |
| 152 | func uw_write_kat(path: *u8, body: *u8) -> i64 |
| 160 | func uw_selftest() -> i64 |