code wiki / _hdl_build / nx_cms_tls_gate.nx
nx_cms_tls_gate.nx
buildroot/runtime/_hdl_build/nx_cms_tls_gate.nx
about
nx_cms_tls_gate.nx -- CMS C8 GATE (re-runnable, evidence-driven): the CMS behind OUR TLS 1.3
front, proven with OUR TLS client doing FULL certificate validation. The gate generates a
self-signed Ed25519 cert sovereignly (nx_x509_build, the andelinwest daemon's cert shape), makes
it the client's ONLY trust anchor, boots the real admin (loopback) behind nx_cms_tls_front (TLS
terminator), and walks the admin flow over the encrypted wire: page serve, login (cookie must now
carry Secure), editor, edit-publish. NEGATIVE CONTROL: a client with an EMPTY trust store must
FAIL the handshake -- proves the validation is real, not pass-through. Appends
"CMSGATE row=nx_cms_tls ... verdict=PASS|FAIL". Exit 0 iff all rows pass. license_tier: ORIGINAL
dependencies 14 imports · 0 importers
diagram shows first 10 each side; +4 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_connect.nxnx_csprng.nxnx_sha256.nxnx_ed25519_signature.nxnx_x509_build.nxnx_x509.nxnx_x509_trust_store.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_tls13_read_record_from_fd.nxnx_cms_store.nxnx_kill_portable.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
| 30 | const TG_FRONT_PORT: i64 = 19861 |
| 31 | const TG_BACK_PORT: i64 = 8086 |
| 32 | const TG_SITE: *u8 = "/tmp/_cms_tls_site" |
| 33 | const TG_SNI: *u8 = "cms.gate.local" |
| 34 | const TG_SNI_N: i64 = 14 |
functions
| 36 | func tg_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 37 | func tg_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 38 | func tg_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 44 | func tg_catn(dst: *u8, off: i64, s: *u8, n: i64) -> i64 |
| 50 | func tg_index(hay: *u8, n: i64, needle: *u8) -> i64 |
| 62 | func tg_has(hay: *u8, n: i64, needle: *u8) -> i64 { if tg_index(hay, n, needle) >= 0 { return 1 } return 0 } |
| 64 | func tg_row(id: i64, ok: i64, what: *u8) -> i64 |
| 74 | func tg_mkdir(path: *u8, mode: i64) -> i64 |
| 81 | func tg_build(name: *u8) -> i64 |
| 102 | func tg_https(store: *TrustStore, req: *u8, rn: i64, resp: *u8, cap: i64) -> i64 called by 1: main calls 12: sys_socketsys_set_socket_timeoutsys_mmapnx_connect_boundedsys_closenx_csprng_fill+6 |
| 179 | func tg_post(req: *u8, path: *u8, cookie: *u8, body: *u8) -> i64 |
| 201 | func tg_get(req: *u8, path: *u8, cookie: *u8) -> i64 |
| 214 | func main() -> i64 |