code wiki / _hdl_build / nx_home_auth_gate.nx

nx_home_auth_gate.nx

buildroot/runtime/_hdl_build/nx_home_auth_gate.nx

7222 B88 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind gate/prooftopic home
docsdependenciesstructsconstsfunctions

about

nx_home_auth_gate.nx -- SOVEREIGN proof of nx_home H4 operator-only auth. Writes a token file, forks /tmp/nx_home.sov.elf with auth enabled, and proves over a loopback socket (no python/shell) that the control plane is GATED: R1 no Authorization -> 401 unauthorized R2 wrong token -> 401 R3 correct token -> 200 + devices R4 correct token POST cmd -> applied (on:1) R5 no-auth POST cmd -> 401 (control gated) R6 no-auth shutdown -> 401 (server not killable w/o auth) then an AUTHED shutdown tears it down. GREEN iff 6/6. Requires /tmp/nx_home.sov.elf. knowledge/status/nx_home_auth_gate.log. license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_connect.nx nx_gate_emit_lib.nx nx_home_auth_gate.nx

imports: nx_syscalls.nxnx_connect.nxnx_gate_emit_lib.nx

imported by: nobody (leaf or entry point)

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

main g_puts sys_write write_file sys_openat_wr sys_write ↻ sys_close sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap sys_execve sys_exit http_req sys_mmap ↻ g_sockaddr sys_socket nx_connect_bounded nx_fcntl sys_connect sys_mmap ↻ sys_poll sys_close ↻ sys_write ↻ sys_read g_strlen sys_wait4 g_contains g_strlen ↻ g_check g_puts ↻ g_num sys_mmap ↻ sys_write ↻ sys_openat_append g_w sys_write ↻ g_wn sys_mmap ↻ sys_write ↻

structs

none

consts

none

functions

13func g_num(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)}; let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(1,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
14func g_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
15func g_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
16func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 2: g_containsmain
17func g_contains(hay: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: g_strlen
23func g_sockaddr(buf: *u8, port: i64, a: i64, b: i64, c: i64, d: i64) -> i64
called by 1: http_req
28func http_req(port: i64, req: *u8, reqlen: i64, resp: *u8, cap: i64) -> i64
40func write_file(path: *u8, data: *u8, len: i64) -> i64 { let fd: i64=sys_openat_wr(path, 0x1a4); if fd<0 { return 0-1 } sys_write(fd, data, len); sys_close(fd); return len }
42func main() -> i64