code wiki / _hdl_build / nx_home_auth_gate.nx
nx_home_auth_gate.nx
buildroot/runtime/_hdl_build/nx_home_auth_gate.nx
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
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
structs
| none |
consts
| none |
functions
| 13 | func 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 } |
| 14 | func 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 } |
| 15 | func 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 } |
| 16 | func g_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 17 | func g_contains(hay: *u8, n: i64, needle: *u8) -> i64 |
| 23 | func g_sockaddr(buf: *u8, port: i64, a: i64, b: i64, c: i64, d: i64) -> i64 called by 1: http_req |
| 28 | func http_req(port: i64, req: *u8, reqlen: i64, resp: *u8, cap: i64) -> i64 |
| 40 | func 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 } |
| 42 | func main() -> i64 |