code wiki / (root) / nx_login_e2e_probe.nx

nx_login_e2e_probe.nx

buildroot/runtime/nx_login_e2e_probe.nx

11070 B183 linesdepth 19pulls 121 transitivereach 0 importersview sourcekind probetopic login
docsdependenciesstructsconstsfunctions

about

nx_login_e2e_probe.nx -- SOVEREIGN end-to-end auth proof (operator: "prove it, no bullshit loop"). Our nx_https_fetch_follow is GET-only; this adds the missing rung: a TLS-1.3 client that POSTs (register/login) and sets X-Nishi-Session (validate at the gated /wiki). It PROVES the wiki-gateway key+realm fix: a token minted by :9091 must validate at :18791 and return GATED CONTENT, not the login/bootstrap. Flow against the LIVE site: POST /register (throwaway handle) -> POST /login -> token -> GET /wiki/creation WITH the token. Reuses the proven connect+handshake (nx_https_url_*, nx_tls13_client_session_run) + the record encrypt/read path lifted from nx_https_get_complete (only the request is pre-built instead of a baked GET). A CLIENT that runs+exits (dev-spoke querying the hub) -- NOT a daemon. license_tier: ORIGINAL expect_exit: 0

dependencies 14 imports · 0 importers

nx_syscalls.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_tls13_client_validate_certifica nx_tls13_client_session_run.nx nx_https_url_for_fetch.nx nx_https_url_connect.nx nx_http_response_parse.nx nx_tls13.nx nx_tls13_record.nx nx_login_e2e_probe.nx

diagram shows first 10 each side; +4 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_http_response_parse.nxnx_tls13.nxnx_tls13_record.nxnx_tls13_read_record_from_fd.nxnx_tls13_client_session.nxnx_chacha20_poly1305.nxnx_u256.nx

imported by: nobody (leaf or entry point)

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

main nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻ x509_read_alg_id sys_mmap ↻ asn1_expect_tag ↻

structs

none

consts

23const K_MAGIC_16645: i64 = 16645
24const K_MAGIC_4194304: i64 = 4194304
25const K_MAGIC_8192: i64 = 8192
26const K_MAGIC_262144: i64 = 262144
27const K_MAGIC_1024: i64 = 1024
29const HOST: *u8 = "nishifamily.com"
30const HOSTLEN: i64 = 15

functions

32func ep(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 1: main calls 1: sys_write
33func epn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var x: i64=v; if x<0 {b[0]=45;sys_write(1,b,1);x=0-x}; if x==0 {b[0]=48;sys_write(1,b,1);return 0} var d: i64=0; var y: i64=x; while y>0 {d=d+1;y=y/10} var i: i64=d-1; y=x; while i>=0 {b[i]=(48+(y%10)) as u8; y=y/10; i=i-1} sys_write(1,b,d); return 0 }
called by 1: main calls 2: sys_mmapsys_write
34func ecat(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 1: e2e_req
35func eslen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
36func econtains(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main
45func ewrite_n(fd: i64, buf: *u8, n: i64) -> i64 { var off: i64=0; while off<n { let w: i64=sys_write(fd, ((buf as i64)+off) as *u8, n-off); if w<=0 { return 0-1 } off=off+w } return 0 }
called by 1: e2e_send calls 1: sys_write
49func e2e_send(s: *Tls13ClientSession, fd: i64, req: *u8, req_len: i64, out: *u8, out_cap: i64) -> i64
87func e2e_req(store: *TrustStore, req: *u8, req_len: i64, out: *u8, out_cap: i64) -> i64
called by 1: main calls 3: nx_scratch_savesys_mmapecat
116func build_post(path: *u8, body: *u8, out: *u8) -> i64
127func build_get_auth(path: *u8, tok: *u8, out: *u8) -> i64
135func extract_token(buf: *u8, n: i64, out: *u8) -> i64
145func main() -> i64