code wiki / _hdl_build / nx_torrent_authn_gate.nx
nx_torrent_authn_gate.nx
buildroot/runtime/_hdl_build/nx_torrent_authn_gate.nx
about
nx_torrent_authn_gate.nx -- referee for the R3 session->level resolver (real OPAQUE, synthetic realm).
Stands up a LIGHT-argon test realm; registers operator/family/stranger. PROVISIONS the roles registry BY
HANDLE via tau_cred_id (operator=3, family=1; stranger ABSENT) -- the derive-from-handle path. Then logs
each in to mint REAL Ed25519 tokens and drives tau_level. The crucial property: the id derived from a
HANDLE (provisioning) equals the id a LOGIN TOKEN resolves to (runtime) -- so a by-handle-provisioned row
actually grants the level at runtime. PROVES deny-by-default end to end:
operator token -> 3 family token -> 1 no token -> 0 garbage -> 0
VALID token w/ NO provisioned role (stranger) -> 0 (leak-check) operator via ngs COOKIE -> 3
GREEN iff every row matches. Prints verdict=GREEN to STDOUT *and* returns the exit code.
Durable -> knowledge/status/torrent_authn_gate.log. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_torrent_authn.nxnx_opaque_login.nxnx_syscalls.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
| 15 | func g_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 16 | 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 } |
| 17 | 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 } |
| 18 | func g_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; 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 } |
| 19 | func rput(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){ dst[off+i]=s[i]; i=i+1 } return off+i } called by 1: main |
| 20 | func rlen(s: *u8) -> i64 { var i: i64=0; while s[i]!=(0 as u8){i=i+1} return i } |
| 21 | func gwrite(path: *u8, s: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x1a4); if fd<0 { return 0 } if n>0 { sys_write(fd, s, n) } sys_close(fd); return 0 } |
| 22 | func chk(got: i64, want: i64, label: *u8) -> i64 |
| 28 | func mint(ctx: *NxAuthContext, handle: *u8, hn: i64, pw: *u8, pwn: i64, tok: *u8) -> i64 |
| 35 | func main() -> i64 |