code wiki / _hdl_build / nx_opaque_login_smoke.nx

nx_opaque_login_smoke.nx

buildroot/runtime/_hdl_build/nx_opaque_login_smoke.nx

14396 B230 linesdepth 12pulls 25 transitivereach 0 importersview sourcekind smoketopic opaque
docsdependenciesstructsconstsfunctions

about

nx_opaque_login_smoke.nx -- R2 smoke: fork the OPAQUE login daemon, drive it as a REAL HTTP client over a socket (POST /register -> POST /login -> GET /whoami[valid] -> GET /whoami[bad token]), proving the no-cookie OPAQUE login works end-to-end over the wire. Requires /tmp/nx_opaque_login_daemon.sov.elf built in the same WSL session (the WOMB emits there). exit 0 = pass, N = assertion N failed. TOOTH 5 (2026-08-18, lane F): the daemon must not GROW under load -- SMK_LEAK_N warm GET / requests must leave its VmSize where the warm-up left it. Bite-proven against the pre-fix binary: every response mapped a fresh 2 MiB compose buffer, so 100 requests moved VmSize by ~204,800 kB; the tolerance is TWO syscall-arena chunks (2 x 256 KiB), the only allocation a warm request path may still legitimately cross.

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_assert.nx nx_hr_admin.nx nx_opaque_login_smoke.nx

imports: nx_syscalls.nxnx_connect.nxnx_assert.nxnx_hr_admin.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main smk_trunc sys_openat_wr sys_close sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real hra_invite hrs_invite hrs_cred_id sys_mmap ↻ nx_ncs_derive_user_id_hash sys_mmap ↻ hrs_hexenc hrs_put_indexed hrs_seg_committed sys_mmap ↻ ss_manifest ss_manifest_file hrs_itoa sys_mmap ↻ hrs_streq hrs_status_code sys_mmap ↻ hrs_get

structs

none

consts

13const SMK_MAGIC_32768: i64 = 32768
14const SMK_MAGIC_2048: i64 = 2048
15const SMK_MAGIC_32767: i64 = 32767
23const SMK_PORT_BASE: i64 = 18099
24const SMK_PORT_SPAN: i64 = 32
26const SMK_LEAK_N: i64 = 100 // requests driven for the growth tooth
27const SMK_LEAK_TOL_KB: i64 = 512 // 2 x NXA_CHUNK (256 KiB) -- the arena may roll one chunk under 100 requests
28const SMK_BUDGET: *u8 = "200" as *u8 // daemon request budget: 4 protocol requests + warm-up + SMK_LEAK_N, with slack
29const SMK_STATBUF: i64 = 4096
30const SMK_READY_TRIES: i64 = 60
31const SMK_READY_MS: i64 = 250
34const DAEMON_ELF: *u8 = "/tmp/nx_opaque_login_daemon.sov.elf" as *u8
39const SMK_HR_PREFIX: *u8 = "/tmp/nx_olgd_smoke_hr" as *u8 // + "-<epoch>-" per run: a fresh, empty store every time
40const SMK_REALM: *u8 = "nishi_site_admin" as *u8
41const SMK_REALM_N: i64 = 16
42const SMK_HANDLE: *u8 = "smoke" as *u8
43const SMK_HANDLE_N: i64 = 5

functions

45func smk_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: smk_postmain
47func smk_pick_port(base: i64, span: i64) -> i64
64func smk_find(buf: *u8, n: i64, needle: *u8, nl: i64) -> i64
called by 2: smk_vmsize_kbmain
71func smk_vmsize_kb(pid: i64, scr: *u8) -> i64
90func smk_trunc(path: *u8) -> i64 { let fd: i64=sys_openat_wr(path, 0x1a4); if fd>=0 { sys_close(fd) } return 0 }
called by 1: main calls 2: sys_openat_wrsys_close
93func smk_http(req: *u8, reqn: i64, resp: *u8, cap: i64) -> i64
107func smk_post(reqbuf: *u8, path: *u8, body: *u8) -> i64
called by 1: main calls 2: smk_slensys_mmap
119func main(argc: i64, margv: *i64) -> i64