code wiki / _hdl_build / nx_email_mime_gate.nx

nx_email_mime_gate.nx

buildroot/runtime/_hdl_build/nx_email_mime_gate.nx

9190 B191 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/prooftopic email
docsdependenciesstructsconstsfunctions

about

nx_email_mime_gate.nx -- GATE for EMAIL R2 (RFC 5322 + MIME, nx_email_mime). COMPLETENESS : header/body split; case-insensitive header find; folded-header unfolding; header append; QP encode/ decode round-trip over arbitrary bytes incl 0x00 and 0xFF; base64 76-col wrap round-trip (composing the canonical nx_base64); multipart assemble + extract. NEG-CONTROL : absent header -> NOT_FOUND; malformed QP "=ZZ" -> BAD_QP; invalid base64 char -> -1. TAMPER : header find is PREFIX-EXACT -- "Subject" returns the real "Subject:" value, never the earlier "X-Subject:" trap (header-confusion / injection defense); a "=CRLF" soft line break decodes away (no spurious bytes). Evidence -> knowledge/status/email_mime.log (MIMEGATE authored=organ ... verdict=GREEN) license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_email_mime.nx nx_syscalls.nx nx_gate_verdict.nx nx_email_mime_gate.nx

imports: nx_email_mime.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap slen nx_mime_split_body memeq nx_mime_header_find mm_ci_eq mm_lower nx_mime_header_append mm_cat nx_mime_qp_encode mm_hexu nx_mime_qp_decode mm_hexval nx_mime_b64_encode_wrap b64_encode b64_enc_char nx_mime_b64_decode_ws b64_decode b64_grab b64_dec_char has_crlf max_line nx_mime_multipart_assemble mm_catn mm_cat ↻ nx_mime_multipart_part mm_match ew sys_write epf ew ↻ ewn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close gv_ctr sys_mmap ↻ gv_verdict

structs

none

consts

22const MIME_LOG: *u8 = "knowledge/status/email_mime.log"

functions

24func ew(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 }
called by 2: epfmain calls 1: sys_write
25func ewn(fd: i64, v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
34func epf(fd: i64, label: *u8, pass: i64) -> i64
called by 1: main calls 1: ew
37func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
38func memeq(a: *u8, b: *u8, len: i64) -> i64 { var i: i64 = 0; while i < len { if a[i] != b[i] { return 0 } i = i + 1 } return 1 }
called by 1: main
39func max_line(buf: *u8, n: i64) -> i64
called by 1: main
47func has_crlf(buf: *u8, n: i64) -> i64
called by 1: main
53func main() -> i64