code wiki / _hdl_build / nx_socks5_client_gate.nx
nx_socks5_client_gate.nx
buildroot/runtime/_hdl_build/nx_socks5_client_gate.nx
about
nx_socks5_client_gate.nx -- GATE for the sovereign SOCKS5 client + the anon transport interface.
TWO proofs, fail-closed:
PART A RFC 1928 KNOWN-ANSWER TEST (pure codec, NO network): greeting + CONNECT request bytes are
byte-exact vs the spec; replies parse; and every negative control (wrong version, REJECT
method, REP!=0 refusal, truncation, bad ATYP) is REFUSED. This is the liar-kill core.
PART B LIVE LOOPBACK TUNNEL: fork a mock SOCKS5 server on 127.0.0.1, drive the REAL s5_connect
through it via anon_connect(ANON_SOCKS5,...), and prove the returned fd carries app bytes
end-to-end (echo round-trip). Closes "codec correct" -> "the live socket path works".
Plus HONESTY invariants: anon_is_anonymizing(SOCKS5)==0 and anon_connect(ANON_TOR)->NOTIMPL --
the interface never pretends a bare proxy is anonymity nor fakes an unbuilt Tor backend.
GREEN iff every row passes. NO external network call (loopback only). Durable
knowledge/status/socks5_client_gate.log. license_tier: ORIGINAL expect_exit: 0
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_socks5_client.nxnx_anon_transport.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
| 17 | func 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 } |
| 18 | func 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} let o:*u8=sys_mmap(24); var i:i64=0; while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 19 | func g_fw(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 } |
| 20 | func g_fn(fd: i64, v: i64) -> i64 { var m: i64=v; 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} let o:*u8=sys_mmap(24); var i:i64=0; while i<k{o[i]=t[k-1-i];i=i+1} sys_write(fd,o,k); return 0 } |
| 23 | func g_row(id: *u8, ok: i64, pass: *i64, tot: *i64) -> i64 |
| 31 | func g_nap(ms: i64) -> i64 { sys_poll(0 as *u8, 0, ms); return 0 } |
| 34 | func g_bytes_eq(buf: *u8, exp: *u8, n: i64) -> i64 { var i: i64=0; while i<n { if buf[i]!=exp[i] { return 0 } i=i+1 } return 1 } |
| 37 | func part_a(pass: *i64, tot: *i64) -> i64 |
| 116 | func mock_socks5_server(lfd: i64) -> i64 |
| 154 | func main() -> i64 |