code wiki / _hdl_build / nx_vault_multi.nx
nx_vault_multi.nx
buildroot/runtime/_hdl_build/nx_vault_multi.nx
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
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
structs
| none |
consts
| 10 | const AT_MAGIC_4096: i64 = 4096 |
| 11 | const AT_MAGIC_65536: i64 = 65536 |
| 12 | const AT_FDCWD: i64 = 0 - 100 |
functions
| 13 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 14 | func vm_run(path: *u8, a1: *u8, a2: *u8) -> i64 |
| 32 | func 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 } |
| 33 | func vm_read(path: *u8, out: *u8, cap: i64, lb: *i64) -> i64 |
| 43 | func 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 |
| 44 | func vm_unlink(path: *u8) -> i64 { __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) return 0 } |
| 46 | func vm_open(vpath: *u8, out: *u8, lb: *i64) -> i64 |
| 51 | func main() -> i64 |