code wiki / (root) / nx_email_send.nx

nx_email_send.nx

buildroot/runtime/nx_email_send.nx

6697 B144 linesdepth 10pulls 16 transitivereach 2 importersview sourcekind librarytopic email
docsdependenciesstructsconstsfunctions

about

nx_email_send.nx -- EMAIL OUTBOUND: compose + DKIM-sign a message. module: nishi-core.email.send depends: nishi-core.email.mime, nishi-core.email.auth, nishi-core.codec.base64 capability: CORE_EMAIL The outbound counterpart to R5's verify: build an RFC 5322 message and attach a real DKIM-Signature (RFC 6376 / 8463 ed25519-sha256) using the domain's private key -- so mail FROM self@jasonewest.com validates at the recipient against the published DKIM public key (see nx_email_dns). Canonicalization: relaxed headers (lowercase name + ":" + unfolded value) over h=from:to:subject, simple body. Sign and verify share the signing-input builder so they are byte-consistent. HONEST SCOPE (no- wave): graded on the sign<->verify round-trip + tamper rejection, not byte-interop with a third-party verifier (the canon subset is fixed). license_tier: INDEPENDENT_REDERIVE genealogy_id: international-research-sources/ietf/rfc_6376 + rfc_8463 lineage_id: nishi_email_send_dkim

dependencies 4 imports · 2 importers

nx_email_mime.nx nx_email_auth.nx nx_base64.nx nx_syscalls.nx nx_email_send.nx nx_email_provision_gate.nx nx_email_send_gate.nx

imports: nx_email_mime.nxnx_email_auth.nxnx_base64.nxnx_syscalls.nx

imported by: nx_email_provision_gate.nxnx_email_send_gate.nx

structs

none

consts

26const K_MAGIC_2048: i64 = 2048
27const K_MAGIC_4096: i64 = 4096
28const K_MAGIC_1024: i64 = 1024

functions

30func es_cat(out: *u8, oi: i64, s: *u8) -> i64 { var k: i64 = 0; while s[k] != (0 as u8) { out[oi] = s[k]; oi = oi + 1; k = k + 1 } return oi }
31func es_catn(out: *u8, oi: i64, s: *u8, n: i64) -> i64 { var k: i64 = 0; while k < n { out[oi] = s[k]; oi = oi + 1; k = k + 1 } return oi }
32func es_find(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64
44func nx_email_compose(from: *u8, to: *u8, subj: *u8, body: *u8, out: *u8, cap: i64) -> i64
called by 2: mainmain calls 1: es_cat
56func es_signing_input(msg: *u8, hlen: i64, dkim_tags_bempty: *u8, tlen: i64, out: *u8) -> i64
72func nx_email_dkim_sign_message(msg: *u8, mlen: i64, priv: *u8, selector: *u8, domain: *u8, out: *u8, cap: i64) -> i64
109func nx_email_dkim_verify_message(smsg: *u8, slen_: i64, pub: *u8) -> i64