nx_email_send.nx
buildroot/runtime/nx_email_send.nx
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
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
| 26 | const K_MAGIC_2048: i64 = 2048 |
| 27 | const K_MAGIC_4096: i64 = 4096 |
| 28 | const K_MAGIC_1024: i64 = 1024 |
functions
| 30 | func 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 } |
| 31 | func 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 } |
| 32 | func es_find(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64 called by 1: nx_email_dkim_verify_message |
| 44 | func nx_email_compose(from: *u8, to: *u8, subj: *u8, body: *u8, out: *u8, cap: i64) -> i64 |
| 56 | func es_signing_input(msg: *u8, hlen: i64, dkim_tags_bempty: *u8, tlen: i64, out: *u8) -> i64 |
| 72 | func nx_email_dkim_sign_message(msg: *u8, mlen: i64, priv: *u8, selector: *u8, domain: *u8, out: *u8, cap: i64) -> i64 |
| 109 | func nx_email_dkim_verify_message(smsg: *u8, slen_: i64, pub: *u8) -> i64 called by 2: mainmain calls 9: sys_mmapnx_mime_split_bodynx_mime_header_findes_findnx_dkim_body_hashb64_encode+3 |