code wiki / _hdl_build / nx_email_send_gate.nx
nx_email_send_gate.nx
buildroot/runtime/_hdl_build/nx_email_send_gate.nx
about
nx_email_send_gate.nx -- GATE for outbound DKIM send (nx_email_send).
COMPLETENESS : compose a message, DKIM ed25519-sha256 sign it, and
verify the signature validates against the public key.
TAMPER : flip a BODY byte -> verify fails (bh mismatch); flip a
signed HEADER byte -> verify fails (sig mismatch).
NEG-CONTROL : verify under a DIFFERENT public key -> fails (it truly
checks the signature, not just structure).
Evidence -> knowledge/status/email_send.log (SENDGATE ... verdict=GREEN)
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_email_send.nxnx_csprng.nxnx_syscalls.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
| 16 | const SEND_LOG: *u8 = "knowledge/status/email_send.log" |
functions
| 18 | 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 } |
| 19 | func epf(fd: i64, label: *u8, pass: i64) -> i64 { ew(fd, label); if pass == 1 { ew(fd, "PASS" as *u8) } else { ew(fd, "FAIL" as *u8) } return 0 } |
| 20 | func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: g_find |
| 21 | func cp(dst: *u8, src: *u8, n: i64) -> i64 { var i: i64 = 0; while i < n { dst[i] = src[i]; i = i + 1 } return 0 } called by 1: main |
| 22 | func g_find(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 32 | func contains(hay: *u8, hlen: i64, needle: *u8) -> i64 { if g_find(hay, hlen, needle) >= 0 { return 1 } return 0 } |
| 34 | func main() -> i64 |