code wiki / _hdl_build / nx_lan_signup_socket_gate.nx

nx_lan_signup_socket_gate.nx

buildroot/runtime/_hdl_build/nx_lan_signup_socket_gate.nx

10035 B154 linesdepth 17pulls 59 transitivereach 0 importersview sourcekind gate/prooftopic lan
docsdependenciesstructsconstsfunctions

about

nx_lan_signup_socket_gate.nx -- proves the LAN-signup daemon's REAL router (lsd_route) end-to-end over a loopback socket with a live OPAQUE context. Forks a server child that runs the EXACT daemon path (accept_with_addr -> ls_ip4_from_sockaddr -> lsd_route) and a sovereign client that connects from loopback. Asserts: (1) an INVITED handle from the LAN peer -> 200 + recovery mnemonic (full OPAQUE register + hra_claim over the wire); (2) a NON-invited handle -> 403 (the invite gate runs on a real socket); (3) GET /hr with NO session -> the owner-only stub, leaking NO roster (the /hr console is owner-gated by default-deny). This closes "compiles" -> "works" for the new accept_with_addr plumbing AND the live /hr gating. license_tier: ORIGINAL expect_exit: 0

dependencies 7 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_lan_signup_routes.nx nx_opaque_login.nx nx_lan_signup.nx nx_hr_admin.nx nx_runpath.nx nx_lan_signup_socket_gate.nx

imports: nx_syscalls.nxnx_connect.nxnx_lan_signup_routes.nxnx_opaque_login.nxnx_lan_signup.nxnx_hr_admin.nxnx_runpath.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap g_w sys_write rp_wsid sys_openat_rd sys_mmap ↻ sys_read sys_close rp_match rp_ensure sys_mmap ↻ sys_now_ms sys_mmap ↻ sys_clock_gettime_mono rp_path sys_openat_wr sys_close ↻ 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 ss_open sys_mmap ↻ ss_hget canon_decode

structs

none

consts

none

functions

16func g_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 3: g_ng_rowmain calls 1: sys_write
17func g_n(v: i64) -> i64 { var m: i64=v; if m<0{g_w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 }
called by 1: main calls 3: g_wsys_mmapsys_write
18func g_row(id: *u8, ok: i64, pass: *i64) -> i64 { g_w(" " as *u8); g_w(id); g_w(": " as *u8); if ok==1 { g_w("OK\n" as *u8); pass[0]=pass[0]+1 } else { g_w("FAIL\n" as *u8) } return 0 }
called by 1: main calls 1: g_w
19func sgt_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o }
called by 2: build_postmain
20func sgt_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o }
called by 1: build_post calls 1: sys_mmap
21func sgt_find(buf: *u8, n: i64, needle: *u8, nl: i64) -> i64 { if nl==0 {return 0} var i: i64=0; while i+nl<=n { var j: i64=0; var ok: i64=1; while j<nl { if buf[i+j]!=needle[j]{ok=0;j=nl} else {j=j+1} } if ok==1 {return i} i=i+1 } return 0-1 }
called by 2: sgt_hasserve_one
22func sgt_has(buf: *u8, n: i64, needle: *u8) -> i64 { var nl: i64=0; while needle[nl]!=(0 as u8){nl=nl+1} if sgt_find(buf,n,needle,nl)>=0 {return 1} return 0 }
called by 1: main calls 1: sgt_find
23func sgt_nap(ms: i64) -> i64 { let ts: *i64 = sys_mmap(16) as *i64; ts[0]=0; ts[1]=ms*1000000; __syscall(35, ts as i64, 0, 0, 0, 0, 0); return 0 }
called by 1: cg_send calls 1: sys_mmap
24func sgt_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: build_post
27func build_post(path: *u8, body: *u8, out: *u8) -> i64
called by 1: main calls 3: sgt_slensgt_catsgt_itoa
38func cg_send(port: i64, raw: *u8, rawlen: i64, resp: *u8, cap: i64) -> i64
64func serve_one(ctx: *NxAuthContext, lfd: i64, hr: *u8) -> i64
81func main() -> i64