code wiki / _hdl_build / nx_vault_multi.nx

nx_vault_multi.nx

buildroot/runtime/_hdl_build/nx_vault_multi.nx

5168 B93 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic vault
docsdependenciesstructsconstsfunctions

about

nx_vault_multi.nx -- MULTI-SECRET vault capability (operator: "like the hashicorp vault"). Proves the team's vault is a real named-secret store: each secret is its own ~/.nishi/secrets/<name>.nv file. SAFETY: GCM IVs MUST be unique per key -- a reused IV is catastrophic. nx_vault derives salt+IV from the VAULT PATH, so distinct names -> distinct files -> distinct IVs by construction. This gate seals TWO different named secrets under the SAME machine key and proves: (1) each opens to its own value; (2) the two vault files carry DIFFERENT IVs (no reuse); (3) the wrong name does not yield the wrong secret. Exercises the real _offc/nx_vault.elf via fork/exec (sovereign-buildable). license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_vault_multi.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main _p sys_write vm_write sys_openat_wr sys_write ↻ sys_close sys_mmap vm_run sys_fork sys_mmap ↻ sys_execve sys_exit sys_wait4 vm_read sys_openat_rd sys_read sys_close ↻ vm_open vm_unlink vm_run ↻ vm_read ↻ vm_streq vm_unlink ↻ sys_exit ↻

structs

none

consts

10const AT_MAGIC_4096: i64 = 4096
11const AT_MAGIC_65536: i64 = 65536
12const AT_FDCWD: i64 = 0 - 100

functions

13func _p(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
14func vm_run(path: *u8, a1: *u8, a2: *u8) -> i64
32func vm_write(path: *u8, s: *u8, n: i64) -> i64 { let fd: i64 = sys_openat_wr(path, 0x180); if fd < 0 { return 0 - 1 } sys_write(fd, s, n); sys_close(fd); return 0 }
33func vm_read(path: *u8, out: *u8, cap: i64, lb: *i64) -> i64
43func vm_streq(a: *u8, an: i64, b: *u8, bn: i64) -> i64 { if an != bn { return 0 } var k: i64 = 0; while k < an { if a[k] != b[k] { return 0 } k = k + 1 } return 1 }
called by 1: main
46func vm_open(vpath: *u8, out: *u8, lb: *i64) -> i64
called by 1: main calls 3: vm_unlinkvm_runvm_read
51func main() -> i64