Commit Graph

128 Commits (25aa151f0ba1837718bc689ab29e89177582f6f4)

Author SHA1 Message Date
Brett Nicholas 25aa151f0b add asymmetric partition sizing for monolithic updates 2026-08-19 17:47:48 +02:00
Daniele Lacamera 3a3f66e1b4 F-9720: describe IMG_STATE_TESTING as the post-swap boot-confirmation state
The comment labeled IMG_STATE_TESTING as an 'ELF loading state', but
the constant is wolfBoot's general dual-bank confirm/rollback marker:
it is set on the BOOT partition after every swap (update_flash.c,
update_flash_hwswap.c, update_ram.c - none ELF-specific) and cleared
by wolfBoot_success(); if still present at the next boot it triggers
a rollback. A maintainer trusting the old comment could have treated
the state as inert on non-ELF targets and disabled the anti-brick
path.

Reword to the accurate description already used in
docs/flash_partitions.md, keeping the note that it only lives on the
boot partition so it cannot conflict with IMAGE_STATE_UPDATING.

Comment-only change; no code or behavior changes.
2026-08-18 05:01:22 +02:00
David Garske c8faa5adc2 Authenticate raw device tree via signed HDR_DEVICE_TREE_DIGEST TLV (Fenrir #7998) 2026-08-13 08:39:22 +02:00
David Garske 4a16dce4f8 efi: authenticate the kernel command line via a signed HDR_CMDLINE manifest TLV 2026-08-10 21:03:50 +02:00
Mattia Moffa ef03cf007f Fix additional findings
- Check diag_erase() return value in wolfBoot_record_failure()
- Dedicated WOLFBOOT_FAILURE_PHASE_SELF_UPDATE
- Mark the diagnostics flash write buffers XALIGNED_STACK(4) for HALs
  that access the source word by word
- Ensure diagnostics, update, or swap partitions don't overlap the
  bootloader
2026-07-02 17:53:12 +02:00
Mattia Moffa 1da9866630 Diagnostics: record additional events
- Failed boot after emergency update (WOLFBOOT_FAILURE_PHASE_RECOVERY)
- Failed verification of self-update image
2026-07-02 17:53:12 +02:00
Mattia Moffa ceaed58782 Allow configuration of diagnostics record size on flash 2026-07-02 17:53:12 +02:00
Mattia Moffa 69e8e044c9 Add unit tests 2026-07-02 17:53:12 +02:00
Mattia Moffa 7cc4990907 Add option to persist boot/update failure info to flash
When boot/update partition verification fails during boot or update,
with this option the event is logged to flash in an ad-hoc partition.
Information about logged failures is made available to the application
through an API.
2026-07-02 17:53:12 +02:00
Brett Nicholas 627e0664a2 fix include order for unit tests 2026-05-05 16:37:54 +02:00
Brett Nicholas a2e9267529 Adds generic cryptocb support for PK, hash, and symmetric crypto 2026-05-05 16:37:54 +02:00
Brett Nicholas 65d84a29ec Add SW-only RSA PSS 2026-04-28 15:02:57 +02:00
Brett Nicholas 2e7839e4ee add additional check for DELTA_UPDATE + DISABLE_BACKUP incompatibility 2026-04-17 08:27:05 +02:00
Brett Nicholas c45268ed7f monolithic self-updates: force DISABLE_BACKUP=1, eliminate swap, eliminate update code 2026-04-17 08:27:05 +02:00
Daniele Lacamera 776378ca78 Preparing release v2.8.0 + update copyright 2026-04-16 13:11:56 +02:00
Daniele Lacamera 3697f9e335 image: use portable noinline macro
F/2273
2026-04-10 21:39:19 +02:00
Daniele Lacamera f5d50d4257 enforce skip-verify prerequisites
F/2256
2026-04-08 19:53:50 +02:00
Brett Nicholas 9debc4c559 Fix XMSS and ML_DSA keygen type mismatch between image headers and keystore by unifying AUTH_KEY_*/KEYGEN_* constants 2026-03-30 16:32:44 +02:00
Mattia Moffa b5fab30310 Enable NSC veneers when TZEN=1, even without WOLFCRYPT_TZ 2026-03-18 22:26:32 +01:00
Thomas Cook 3b1ef9d6bc Address copilot pr comments. 2026-03-18 11:53:26 +01:00
Thomas Cook dd4312679b Deploy NO_DIRECT_READ_OF_ERASED_SECTOR to protect against hardfault with AHB read of erased sector. 2026-03-18 11:53:26 +01:00
Daniele Lacamera 4eca085b54 Added USE_CLANG option to Makefile 2026-03-10 15:49:45 +01:00
Daniele Lacamera 19d562dbde Fixed build errors with cross-clang compiler 2026-03-10 15:49:39 +01:00
David Garske a5356b830a NXP T2080 Port Refresh
* Initial port refresh for the NXP T2080 target
* IFC Flash driver and multi-core support on T2080
* Working wolfBoot test-app startup on T2080
* Support for NAII and Curtiss-Wright T2080 vendor boards
2026-03-05 17:49:37 +01:00
Brett Nicholas 4d31ef5502 Add self-header feature with support for sim and AURIX TC3xx 2026-02-27 11:39:51 +01:00
David Garske 12d7f0a153 Improved encryption constants between the bootloader and the signing tool. Allows the sign tool to properly use the correct block size for each encryption algorithm (64 for ChaCha, 16 for AES). 2026-01-05 20:37:04 +01:00
Mattia Moffa f12d2f06b4 Add PKCS11 backend for encrypted partitions 2025-12-30 11:15:41 +01:00
gojimmypi 985e2f76c0 Improve image header default size, check for dupe hash def 2025-12-12 17:47:09 +01:00
David Garske 8cb3d33339 Added STM32H5 SPI Driver and support for TPM
Cleanup STM32H5 HAL port.
Refactor `__ARM_FEATURE_CMSE` to `TZ_SECURE()`
Refactor attribute cmse_nonsecure_entry to use new macro `CSME_NSE_API`
Added TPM Non Secure Callable API's
Added TPM support to STM32H5 test application
2025-11-19 16:29:28 +01:00
Mattia Moffa 177358e88d Update H5 app to use new NSC API
- Make the update and swap partitions secure and inaccessible from the
  app except via NSC API
- Add a couple of necessary new NSC functions
- Update the app to only use NSC API
- Fix hal_flash_erase to account for secure addresses
- Fix some bugs in xmodem implementation
2025-10-29 00:13:01 +01:00
Daniele Lacamera 18cbea59de Refactoring of IV handling to prevent reusing IVs
During fallback operations, use a different encryption IV than the one
used to encrypt the backup during the update. This ensures that the same
IV is never reused to encrypt different sectors.
2025-10-17 09:44:46 +02:00
gojimmypi fbd8dcf8a2
Update Copyright year to 2025 2025-10-15 11:33:53 -07:00
David Garske 0ce77a4d27
Merge pull request #590 from danielinux/flash-write-as-nsc
NSC functions: add helper to facilitate updates as trustzone non-secure callable
2025-10-07 09:21:02 -07:00
Daniele Lacamera 568452552c Fix corruption of last boot sector with encryption
As reported by @reza-hdd in #589:

> When Firmware is large enough to consume all the allocated boot partition sectors, in the the final swap and erase operations (_wolfBoot_swap_and_final_erase_) the last sector of FW in Boot partition, which is used as a temporary sector for a copy operation, gets corrupted after being copied in external Swap partition and copied back. It looks like the contents are copied to the external Swap partition without being encrypted, but get decrypted when it is read back.

This was due to the function wolfBoot_copy_sector() assuming that all
copies having an external SWAP as destination would not need any
encryption, as the "normal" case during update is to copy already
encrypted sectors from UPDATE->SWAP.

In the final state, after the update is successfully applied, the
mechanism saves a copy of the last sector from BOOT->SWAP. In this case,
if the application is big enough, an extra function is needed to
encrypt the content of this last sector before writing it to SWAP.

Restoring the backup is OK (normal case SWAP->BOOT, decryption was
already there as also noted by the reporter).
2025-09-10 13:27:22 +02:00
Daniele Lacamera cd347b5886 Fix visibility of new nsc declarations 2025-09-05 18:14:04 +02:00
Daniele Lacamera 82e4950b59 Added NSC functions to facilitate updates from NS application 2025-09-05 14:12:50 +02:00
David Garske 73fc193931 Portability fixes with include < vs ". Added `NO_SWAP_EXT` to allow support for onboard flash swap sector. Added `WOLFSSL_NO_CT_OPS` for ECDSA verify only. Added `WC_NO_DEFAULT_DEVID` to help with code size reduction. 2025-06-16 19:05:49 +02:00
David Garske 9451b47628 Fix for Renesas TSIP key types. Fix for Renesas RX .keystore location in linker script. Fix for wolfBoot as library with Renesas to make sure crypto hardware is initialized and setup. Add forced alignment on additional buffers used for flash read/write. 2025-06-16 19:05:49 +02:00
David Garske 487efc606d Improvements for portability using older gcc 4.8.2. Make sure wolfboot.h includes the `wolfBoot_verify_*` API's. Fixed issue with parsing headers when `#include` is `# include`. 2025-06-16 19:05:49 +02:00
Brett Nicholas 7660bf66f8 Add wolfHSM cert chain verification for ECC and RSA 2025-05-27 15:42:59 -06:00
Brett Nicholas d49e507926 - Support external flash for elf scatter-loading
- Support ELF scatter-loading on TC3xx
- Modify TC3xx HAL flash erase to support arbitrary offsets and sizes
- Realign partition size and addresses to support more efficient sector mass erase on update
2025-05-08 08:50:26 -06:00
Daniele Lacamera ea0b4fb935 Added missing files + cosmetics as per review
- Added missing `test-app/app_sim_scattered.c`
- Added missing `test-app/sim_scattered.ld`
- Fixed comments at the end of define blocks for consistency
- Removed unused constants as indicated
2025-04-11 15:55:05 +02:00
Daniele Lacamera 386a172587 Fix regressions detected by github workflows 2025-04-07 17:10:37 +02:00
Daniele Lacamera 11091944d7 ELF_SCATTERED: added sha check (WIP) 2025-04-04 19:15:04 +02:00
Brett Nicholas fb6ca4378f WIP: structure is there, but some major issues. See WOLFBOOT-ELF-LOADER-GAPS.md and video 2025-04-03 09:53:00 +02:00
David Garske 4991eabb18 Peer review fixes. Default to ML-DSA level 2. 2024-12-05 13:39:47 -08:00
David Garske 35b98e723b Fix the Windows keytools artifact upload. 2024-12-05 11:32:22 -08:00
David Garske 4ac4de51ac Fix ML-DSA level comment. 2024-12-05 10:29:00 -08:00
Daniele Lacamera d5e402ebde Removing compile-time parameters from keygen 2024-12-03 14:50:54 +01:00
Daniele Lacamera 04d2ecd246 Remove dependency from PQC parameters. Speed up tests. 2024-12-02 18:55:32 +01:00