code wiki / _hdl_build / nx_fw_uefi_capsule.nx
nx_fw_uefi_capsule.nx
buildroot/runtime/_hdl_build/nx_fw_uefi_capsule.nx
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
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
structs
| none |
consts
| 21 | const UC_HDR: i64 = 28 // sizeof(EFI_CAPSULE_HEADER) |
| 22 | const UC_SIG: i64 = 64 // ed25519 signature |
| 23 | const UC_HEADERSIZE: i64 = 28 // the HeaderSize field value |
| 24 | const UC_MAXIMG: i64 = 16777216 |
functions
| 27 | func uc_guid_write(buf: *u8) -> i64 |
| 34 | func uc_guid_match(buf: *u8) -> i64 |
| 42 | func uc_header_ok(buf: *u8, total: i64) -> i64 |
| 51 | func uc_make(path: *u8, payload: *u8, plen: i64, seed: *u8) -> i64 |
| 69 | func uc_verify(path: *u8) -> i64 called by 4: cap_selectmainmainmain calls 5: sys_mmapcp_readuc_header_okcap_trusted_pubed25519_verify_full |
| 83 | func uc_corrupt(path: *u8) -> i64 |
| 92 | func uc_flip_guid(path: *u8) -> i64 |
| 102 | func main() -> i64 |