Commit Graph

3947 Commits (80dbb6da15ab5eb348f5d76049dabd03be5bdd67)

Author SHA1 Message Date
David Garske 80dbb6da15 update_disk: golden slot tried after the A/B attempts, exempt from anti-rollback and never written 2026-10-07 20:07:38 -07:00
Mattia Moffa aa88c79885
Merge pull request #927 from dgarske/disk_debug_uart
Fix the DEBUG_UART=0 build for update_disk boot targets
2026-10-07 20:42:18 +02:00
David Garske 84603a5054 gzip: table-driven Huffman decoder by default, GZIP_SMALL=1 keeps the bit-serial one 2026-10-07 16:54:53 +02:00
David Garske 5ecce1a6c9 disk: fix the DEBUG_UART=0 build for every disk boot target 2026-10-06 20:11:29 -07:00
David Garske 94bcb81e68 docs: use a generic path in the VA416x0 build log output 2026-10-06 18:33:50 +02:00
David Garske 3a0cca7a91 build: libgcc-free RISC-V FDT byte swaps, prebuilt keytools, LDFLAGS_EXTRA 2026-10-06 18:33:10 +02:00
David Garske d02e8e56c5 psoc_c3: let an application override the fault handlers 2026-10-06 18:14:10 +02:00
David Garske 2a337e72c6 i2c: add a bit-banged back-end selectable with I2C_BITBANG 2026-10-06 18:14:10 +02:00
David Garske 508ad6a26d Add wolfBoot target for Infineon PSOC Control C3 2026-10-06 18:14:10 +02:00
David Garske 97e895613d tpm: add a TIS-over-I2C transport and a generic I2C driver interface 2026-10-06 18:14:10 +02:00
David Garske a16e2e8f11
Merge pull request #912 from bigbrett/tc3-toolchain-support
Expand TC3xx toolchain support
2026-10-02 08:02:29 -07:00
David Garske eb710fe165
Merge pull request #919 from danielinux/release-v2.10-fixup
CMake: uniform the WOLFCRYPT_TZ_PSA flags with options.mk; fix hex version number
2026-10-01 09:52:27 -07:00
Daniele Lacamera 52a1dab1f2 CMake: fix PSA source selection per review (paths, booleans, chacha, ELS) 2026-10-01 18:36:23 +02:00
Daniele Lacamera 6f51a76991 CMake: add the PSA implementation sources; validate WOLFBOOT_DICE_HW 2026-10-01 18:15:43 +02:00
Daniele Lacamera 35d315a6ff CMake: uniform the WOLFCRYPT_TZ_PSA flags with options.mk; fix version hex 2026-10-01 18:00:54 +02:00
David Garske 20ea6423e1
Merge pull request #918 from danielinux/prepare-release-v2.10.0
Prepare release v2.10.0
2026-10-01 08:47:46 -07:00
Daniele Lacamera f56551ab74 address PR 918 review: TOUCH_LINES AES, finish ESP256 migration in docs
WOLFPSA_AES_FAST replaced with WOLFSSL_AES_TOUCH_LINES per the wolfPSA
5.9.4 constant-time policy; DICE.md and the MCXN verifier comment now say
ESP256 and state the RFC 9783 legacy-ID compatibility note.
2026-10-01 17:20:43 +02:00
Daniele Lacamera 3edf517d4b wolfPSA: point at the released v5.9.4 tag 2026-10-01 16:15:10 +02:00
Daniele Lacamera 7b480de33a prepare-release-v2.10.0: release notes and version bump 2026-10-01 15:42:17 +02:00
Daniele Lacamera c3cc71503a options: satisfy wolfPSA v5.9.4 build policy for TZ_PSA
WC_ALLOW_ECC_ZERO_HASH and WOLFPSA_AES_FAST per the new psa_config.h
checks (bitsliced AES blows the GCM stack budget), and exclude the new
psa_store_zephyr.c from the custom-store build.
2026-10-01 15:05:49 +02:00
Daniele Lacamera 6f6a1df84b prepare-release-v2.10.0: update submodules to latest releases
wolfSSL v5.9.4-stable, wolfPSA v5.9.4, wolfCOSE v2.0.0; wolfHSM
left at v1.5.0-8-g86dd6df. wolfPSA v5.9.4 changes the store Close
return to int; wolfCOSE v2.0.0 splits the source into 15 files and
drops the deprecated ES256 alg ID, so DICE now signs with ESP256.
2026-10-01 14:44:49 +02:00
David Garske 26a157868f
Merge pull request #917 from danielinux/fenrir-fixes-2026-09-30
Fenrir fixes 2026 09 30
2026-09-30 16:11:29 -07:00
Daniele Lacamera 9886303160 multiboot: debug parser counts u32 request entries too
mb2_parse_info_request_tag() (DEBUG_MB2) still divided by
sizeof(uint16_t) after the u32 revert, doubling the entry count and
reading (size-8) bytes past the tag. Same width, one more call site.
2026-09-30 21:58:29 +02:00
Daniele Lacamera fd9158e217 multiboot: request-list entries are u32 per spec v2.0
The F-14470 fix changed the info-request entry width to 16-bit on a
misreading of the spec: Multiboot2 v2.0 defines mbi_tag_types as
u32[n] ("an array of u32's"), and the original code already divided
by sizeof(uint32_t). A 32-bit request {4} was misread as {4, 0}, so
the follow-up zero-skip was only papering over the misparse; real
FSP images with a mandatory request tag stopped booting (fsp_qemu
CI). Restore the u32 width, drop the zero-skip, and rebuild the
test fixtures with 32-bit entries.
2026-09-30 20:18:10 +02:00
Daniele Lacamera 48e06b898a multiboot: treat a zero request-list entry as padding
F-14470 corrected the request-list entry width to the spec's 16-bit,
which doubled the entry count. Intel FSP pads the list so the last
entry is zero (the end-tag type), and the old 32-bit width never
reached it. A zero entry is padding, not a mandatory request: skip
it, so FSP images keep booting. New test covers a zero-padded list.
2026-09-30 19:59:33 +02:00
Daniele Lacamera 78797a946d hal: scrub the TRNG staging buffers without wolfCrypt
F-14487/F-14488 scrubbed the TRNG staging buffers with wc_ForceZero,
which links the hal objects to wolfCrypt's memory.c. The OTP keystore
primer links the hal without wolfCrypt and failed to build
(undefined reference to wc_ForceZero) in the stm32h5_tz_dualbank_otp
and trustzone-emulator configs. Scrub with a local volatile loop, the
same pattern nvm_cache_scrub uses for the same reason.
2026-09-30 19:59:33 +02:00
David Garske c83238ae71
Merge pull request #914 from bigbrett/tc3-host-park
TC3: Add host park functionality
2026-09-30 09:07:45 -07:00
Daniele Lacamera ce814dd532 F-14488: scrub the STM32 TZ TRNG word in hal_trng_get_entropy
The secure-mode TRNG seed helper (shared by the STM32L5/U5/H5
TrustZone ports) staged each TRNG_DR word in a stack local and
returned without clearing it. Force-zero the local before the
return, mirroring the existing scrub in hal/cm4.c.
2026-09-30 16:33:53 +02:00
Daniele Lacamera e280cf1e7c F-14487: scrub the nRF5340 TRNG staging batch in hal_trng_get_entropy
The secure-mode TRNG seed helper copied each 24-byte CryptoCell EHR
batch into a stack array and returned without clearing it, leaving
raw TRNG output in the retired secure frame. Force-zero the batch at
the end of each iteration, mirroring the existing scrub in hal/cm4.c.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 7896d2d70f F-14486: read policy_sign key files unbuffered
loadFile() in the TPM policy-signing tool read the private key
through a fully buffered stdio stream, leaving a libc-owned copy of
the key material that outlives the call. Open the file unbuffered
(setvbuf _IONBF), the same pattern sign.c already uses for its key
reads.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 2ac990b642 F-14485: snapshot the legacy PBKDF2 password length once
nsc_mech_prepare() read the non-secure legacy ulPasswordLen pointer
twice: once to size the secure password copy, once again (via nsc_in)
to fill the secure length word the library dereferences. A concurrent
non-secure write between the two reads could desync the length from
the password buffer size. Take a single snapshot and write it into
the secure length word directly. Add the missing test for the legacy
branch: the stub now consumes the length the way wolfPKCS11 does
(through the bounced pointer) and checks scrubbing.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 4eb6305c54 F-14470: accept optional/missing multiboot2 info requests
mb2_build_boot_info_header() rejected a valid OS image header when
the optional information-request tag was missing, and rejected any
request type it did not implement without checking the tag's
optional flag (bit 0) the spec defines for skipping. A well-formed
header without the tag now requests nothing, optional unsupported
requests are skipped, and only a mandatory unsupported one rejects
the image. The finder returns NULL for a missing tag and for a
malformed tag list alike, so the absent case walks the list to tell
the two apart: any corrupt tag rejects the header. Tests updated to
the spec semantics (optionality driven by the tag flags) plus
malformed-list cases.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 45e35ddb2d F-14469: quad-enable writes back the status register it read
qspi_quad_enable() memset the status register it had just read before
setting the QE bit, so the write-back zeroed every other writable bit
(SRL/CMP in SR2, BP/SRWD on the SR1 path) on the first probe of a part
with QE clear. Drop the memset so the write is a read-modify-write.
Test pins the preserved-bits write and the no-write sunny path.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 7069f986ca F-14468: record verify-failure version via get_image_version
wolfBoot_record_verify_failure() read the image version from
img->hdr, which for an external-flash image is a device offset, not
a CPU address: the persistent record stored a garbage version, and
the read can fault where the offset is unmapped. Read the version
through wolfBoot_get_image_version(part), which fetches external
headers via ext_flash_check_read. No unit test compiles
update_flash.c with WOLFBOOT_PERSIST_FAILURE_STATUS, so add a
compile check for that ext-flash configuration to the gate.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 7913b91c99 F-14484: reject non-BOOT/UPDATE parts in get_partition_state
wolfBoot_get_partition_state() only rejected PART_NONE, so any other
part byte (SWAP, SELF, unknown) passed through the NSC veneer to a
NULL dereference of get_partition_magic() in secure code. Reject
every part without a trailer at the shared entry; the NSC veneer
delegates here, so a non-secure caller can no longer crash the
secure world. The mock get_trailer_at() now matches the real one
(NULL for parts without a trailer), which is what lets the test
prove the deref.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 3cd94aa3f0 F-14483: pin the RSA DigestInfo in RsaDecodeSignature
The parser read the SEQUENCE length without checking it, skipped the
AlgorithmIdentifier without comparing it, and ignored trailing bytes,
so only the digest length was pinned. Any free byte in the message is
forgeable with a low-exponent key (e=3) via Bleichenbacher 2006, and
keygen -i imports exponents unchecked. Require the SEQUENCE to span
the whole payload, the AlgorithmIdentifier to match the configured
hash OID byte for byte, and the OCTET STRING to end at the payload
end. Test pins the exact wc_EncodeSignature() encoding and rejects
trailing bytes and the empty-algoid forge shape.
2026-09-30 16:33:53 +02:00
Daniele Lacamera 11b7e7832e F-14467: use UPDATE size for write-once trailer erase sector
nvm_select_fresh_sector() gets the PART_UPDATE flag base from
PART_UPDATE_ENDFLAGS (UPDATE size) but computed addrErase with the
BOOT size, a copy-paste from the BOOT branch. The two are equal in
every compilable write-once build today (asymmetric sizes are
#error'd without SELF_UPDATE_MONOLITHIC, which is incompatible with
write-once), so align the erase sector with the base.
2026-09-30 14:30:29 +02:00
David Garske 4c79eee999 x86 FSP: fix linux-loader unit-test link for wolfBoot extent symbols and guard the setup-header read 2026-09-30 09:25:16 +02:00
David Garske 8865adc01c x86 FSP: split kernel copy vs decompress overlap checks and gate on boot protocol 2.10 2026-09-30 09:25:16 +02:00
David Garske b55e01f0ec x86 FSP: reject kernel/initrd load targets that overlap wolfBoot or the payload 2026-09-30 09:25:16 +02:00
David Garske bd1bc31ed1 x86 FSP: address review - shared fsp_handle_reset, UART number/mode, always re-hash OS digest 2026-09-30 09:25:16 +02:00
David Garske 0fa293540a x86/FSP: select the FSP debug UART controller with X86_UART_NUMBER 2026-09-30 09:25:16 +02:00
David Garske db04b6c365 docs: document the x86 FSP Linux bzImage/initrd payload, OS PCR measurement, and UPD decoder 2026-09-30 09:25:16 +02:00
David Garske 3d197cb8c7 x86 FSP: load an optional initrd alongside the Linux bzImage payload 2026-09-30 09:25:16 +02:00
David Garske 45d2b092f3 tpm: build wolfBoot_print_hexstr for measured boot, not only seal or keystore 2026-09-30 09:25:16 +02:00
David Garske d51df7819b x86 FSP: measure the disk OS image into a configurable PCR 2026-09-30 09:25:16 +02:00
David Garske e8b9087f7b x86 FSP: initialise hobList before FspMemInit 2026-09-30 09:25:16 +02:00
David Garske 6a1f13e846 x86 FSP: add the 64-bit Linux boot protocol to the bzImage loader 2026-09-30 09:25:16 +02:00
David Garske 12bebb4859 x86 FSP: honour NotifyPhase reset requests, including the Tiger Lake global reset 2026-09-30 09:25:16 +02:00
David Garske baf51e7078 tools: add an x86 FSP UPD decoder driven by the FspmUpd.h offset comments 2026-09-30 09:25:16 +02:00