code wiki / _hdl_build / nx_smtp_client_gate.nx
nx_smtp_client_gate.nx
buildroot/runtime/_hdl_build/nx_smtp_client_gate.nx
about
nx_smtp_client_gate.nx -- GATE for EMAIL R1 (SMTP client, nx_smtp_client).
Drives the REAL nx_smtp_client codec + state machine over scripted
transcripts (no network, fully deterministic) and asserts:
COMPLETENESS : multiline 250 reply parses to code=250/complete=1;
220 greeting + 354 data-go parse; EHLO/MAIL/RCPT/
QUIT/DATA builders emit exact CRLF-framed bytes;
dot-stuffing turns a lone "." line into ".." and
terminates with <CRLF>.<CRLF>; the state machine
walks the full happy path to DONE.
NEG-CONTROL : a 550 at RCPT routes the state machine to ABORT/FAIL
(no DATA is ever sent to a rejected recipient).
TAMPER reply : a continuation line whose code differs from the
first line -> CODE_MISMATCH; a non-digit code ->
BAD_CODE; a continuation with no final line ->
parsed but complete=0 (not treated as a finished
reply -- streaming/forgery safe).
TAMPER inject: the dot-stuffed body contains the "<CRLF>.<CRLF>"
terminator EXACTLY ONCE, at the very end -- a lone
"." line cannot prematurely terminate DATA (SMTP
injection / truncation defense, RFC 5321 ยง4.5.2).
Evidence -> knowledge/status/smtp_client.log
(SMTPCLIENTGATE authored=organ ... verdict=GREEN)
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_smtp_client.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
structs
| none |
consts
| 31 | const SMTP_LOG: *u8 = "knowledge/status/smtp_client.log" |
functions
| 33 | func 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 } |
| 34 | func ewn(fd: i64, v: i64) -> i64 |
| 44 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 45 | func 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 |
| 46 | func find_sub(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: main |
| 57 | func count_sub(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: main |
| 69 | func main() -> i64 |