code wiki / _hdl_build / nx_connect_pubkey_bind_gate.nx

nx_connect_pubkey_bind_gate.nx

buildroot/runtime/_hdl_build/nx_connect_pubkey_bind_gate.nx

11868 B220 linesdepth 4pulls 13 transitivereach 0 importersview sourcekind gate/prooftopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_pubkey_bind_gate.nx -- proves the CONNECT pubkey directory BINDS keys to an authenticated identity, so trust-on-first-use is dead: once a handle is verified under an account, no other account and no anonymous caller can substitute a different key for it. A relay operator or impostor therefore cannot man-in-the-middle the key directory. Tests cs_sh_pub_put2 directly AND through the live /connect/pubkey route (ctx[CS_UID] stamped exactly as the daemon does), plus a compaction round-trip proving the owner+verified binding is DURABLE across a boot replay. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_connect_serve.nx nx_connect_pubkey_bind_gate.nx

imports: nx_connect_serve.nx

imported by: nobody (leaf or entry point)

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

main pb_w pb_uid cs_shared_new sys_mmap cs_sh_pub_put2 cs_name_ok cs_hex_len cs_sh_pub_find cs_seq sh_pub_at sh_own_at cs_eq32 sh_pub_at ↻ cs_sh_copyz cs_copy32 sh_own_at ↻ cs_sh_pub_find ↻ pb_check pb_w ↻ cs_eq32 ↻ sh_pub_at ↻ cs_seq ↻ cs_world_new sys_mmap ↻ cs_world_reset cs_cat pb_post cs_slen cs_cat ↻ cs_catn cu_putn cs_handle2 cs_starts sys_mmap ↻ cs_slen ↻ cs_seq ↻ cs_cat ↻ cs_catn ↻ cs_json_resp

structs

none

consts

10const PB_BUF: i64 = 262144

functions

12func pb_w(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 3: pb_npb_checkmain
13func pb_n(v: i64) -> i64 { let t: *u8=sys_mmap(32); let o: i64=cu_putn(t,0,v); t[o]=0 as u8; pb_w(t); return 0 }
called by 1: main calls 1: pb_w
14func pb_check(pass: i64, label: *u8, fails: *i64) -> i64
called by 1: main calls 1: pb_w
19func pb_has(buf: *u8, n: i64, needle: *u8) -> i64
called by 1: main calls 1: cs_slen
32func pb_post(dst: *u8, path: *u8, body: *u8) -> i64
called by 1: main calls 3: cs_slencs_catcs_catn
42func pb_get(dst: *u8, path: *u8) -> i64
called by 1: main calls 1: cs_cat
49func pb_uid(buf: *u8, tag: i64) -> i64 { var i: i64=0; while i<32 { buf[i]=((tag+i) & 0xff) as u8; i=i+1 } return 32 }
called by 1: main
51func main() -> i64