code wiki / (root) / nx_provstmt.nx

nx_provstmt.nx

buildroot/runtime/nx_provstmt.nx

6273 B141 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_provstmt.nx -- CR3 of /compare/capregistry: ATTEST THE PROMOTED ARTIFACT, NOT THE EVIDENCE FRAME. nx_provstmt <target> <artifact_sha256> <src_sha256> <closure_sha256> [out.json] WHERE THE ARGUMENTS COME FROM, because they are the whole point: /api/build's response carries src_sha256 and closure_sha256, and /api/promote's response carries the live artifact sha256 after the rename. The estate computes real SLSA build provenance on every build and every caller discards it at the end of the HTTP response. This organ is the missing last step: bind those already-computed digests to the artifact they describe and write the in-toto ITE-6 Statement down. THE POLICY THAT MAKES IT SAFE TO RUN LATE: the organ RE-HASHES THE LIVE ARTIFACT ITSELF and refuses when the computed digest differs from the receipt's. Without that check, a stale receipt -- from before a sibling's re-promote, or from a build that never went live -- would mint a Statement binding provenance to bytes that are NOT being served: a false attestation with a valid shape, which is worse than none. The in-toto spec matches subjects PURELY BY DIGEST, so the digest being right is the entire contract. EXITS: 0 statement written, receipt printed | 1 ATTEST-REFUSED, live artifact hash differs from the receipt (both digests printed; NOTHING written) | 2 usage / malformed digest (names WHICH argument) | 3 UNPROVEN, live artifact unreadable -- an absent artifact must abstain, never attest.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_sha256.nx nx_provstmt_lib.nx nx_provstmt.nx

imports: nx_syscalls.nxnx_sha256.nxnx_provstmt_lib.nx

imported by: nobody (leaf or entry point)

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

main pvo_puts sys_write pvo_len pv_hex_ok sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ pvo_mk sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_seed_allocated sha256_k sha256_update sha256_compress_ni_blocks blk_set_byte sha256_compress sha256_compress_ni blk_word

structs

none

consts

25const PVO_NAME_CAP: i64 = 128
26const PVO_PATH_CAP: i64 = 512

functions

28func pvo_puts(s: *u8) -> i64
called by 1: main calls 1: sys_write
35func pvo_len(s: *u8) -> i64
called by 1: main
41func pvo_mk(dst: *u8, a: *u8, b: *u8) -> i64
called by 1: main
51func main(argc: i64, argv: *i64) -> i64