code wiki / _hdl_build / nx_fw_uefi_capsule.nx

nx_fw_uefi_capsule.nx

buildroot/runtime/_hdl_build/nx_fw_uefi_capsule.nx

5992 B119 linesdepth 10pulls 14 transitivereach 2 importersview sourcekind tooltopic fw
docsdependenciesstructsconstsfunctions

about

nx_fw_uefi_capsule.nx -- a REAL EFI_CAPSULE_HEADER + sovereign ed25519 authentication. module: nishi-core.genealogy.fw_uefi_capsule capability: CORE_COMPUTE (real-firmware-shaped signed capsules) The NXC1 capsule (rung 8) was our own layout. A real UEFI capsule starts with the spec struct EFI_CAPSULE_HEADER: EFI_GUID CapsuleGuid; // 16 -- identifies the capsule type (here: the Nishi FW-capsule GUID) UINT32 HeaderSize; // 4 -- size of this header (28) UINT32 Flags; // 4 UINT32 CapsuleImageSize;// 4 -- total size of the capsule (header + body) == 28 bytes, then the body. Here body = payload + a 64-byte ed25519 signature over (header || payload). So a UEFI capsule parser sees a valid header+GUID+size; OUR verifier adds authenticity via sovereign ed25519. HONEST: the HEADER is the real UEFI struct; the AUTH is sovereign ed25519 (NOT the UEFI PKCS7 / Authenticode EFI_FIRMWARE_IMAGE_AUTHENTICATION, which needs X.509/PKCS7 -- a separate lift). Sandboxed. Sovereign: nx_fw_capsule (-> nx_ed25519, cp_* helpers) + nx_syscalls. license_tier: ORIGINAL

dependencies 2 imports · 2 importers

nx_fw_capsule.nx nx_syscalls.nx nx_fw_uefi_capsule.nx nx_fw_capstone_gate.nx nx_fw_uefi_capsule_gate.nx

imports: nx_fw_capsule.nxnx_syscalls.nx

imported by: nx_fw_capstone_gate.nxnx_fw_uefi_capsule_gate.nx

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

main cp_puts sys_write sys_now_realtime_sec sys_mmap sys_clock_gettime_real sys_mmap ↻ cap_plat_seed cap_path cp_cat cp_catn sys_mmap ↻ uc_make sys_mmap ↻ uc_guid_write cp_wr_u32 ed25519_sign_full sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 sha512_gamma1 sha512_sigma1 sha512_ch sha512_k sha512_sigma0 sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻

structs

none

consts

21const UC_HDR: i64 = 28 // sizeof(EFI_CAPSULE_HEADER)
22const UC_SIG: i64 = 64 // ed25519 signature
23const UC_HEADERSIZE: i64 = 28 // the HeaderSize field value
24const UC_MAXIMG: i64 = 16777216

functions

27func uc_guid_write(buf: *u8) -> i64
34func uc_guid_match(buf: *u8) -> i64
42func uc_header_ok(buf: *u8, total: i64) -> i64
51func uc_make(path: *u8, payload: *u8, plen: i64, seed: *u8) -> i64
69func uc_verify(path: *u8) -> i64
83func uc_corrupt(path: *u8) -> i64
called by 2: mainmain calls 3: sys_mmapcp_readcp_write
92func uc_flip_guid(path: *u8) -> i64
called by 2: mainmain calls 3: sys_mmapcp_readcp_write
102func main() -> i64