Commit Graph

402 Commits (enc_block_size)

Author SHA1 Message Date
David Garske 601e46e480 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). 2025-12-31 11:25:09 -08:00
Mattia Moffa f12d2f06b4 Add PKCS11 backend for encrypted partitions 2025-12-30 11:15:41 +01:00
David Garske 609fd81890 Fixes for PolarFire SoC eMMC/SD to stabilize and add read DMA support. Refactor the RISC-V boot/vector code for use on both 32-bit and 64-bit architectures. 2025-12-30 11:10:21 +01:00
David Garske 963cdadeaf Peer review fixes 2025-12-24 18:31:55 +01:00
David Garske 3317fba381 Cleanups and improvements 2025-12-24 18:31:55 +01:00
David Garske 0292da582b Refactor disk.c for generic use. Wired up uSD read for MBR/GPT 2025-12-24 18:31:55 +01:00
David Garske e055585942 Support for Microchip PolarFire SoC (MPFS250) 2025-12-24 18:31:55 +01:00
Mattia Moffa 5134eea96a Support WOLFCRYPT_TZ and PKCS11 on nRF5340 2025-12-13 04:05:32 +01:00
gojimmypi 985e2f76c0 Improve image header default size, check for dupe hash def 2025-12-12 17:47:09 +01:00
Brett Nicholas 6a1120d0ab -add wolfHSM RSA4096 configs for sim and AURIX
-various fixes for RSA4096
-remove erroneous coupling between SMALL_STACK and WOLFHSM_SERVER
2025-12-10 07:43:32 +01:00
Brett Nicholas 57b874be2d Simplify use of user-supplied keys and certificates with test app via
new `USER_ variables`
2025-12-10 07:43:32 +01:00
Daniele Lacamera 3b3aa2e7c3 Updated ChangeLog & version number.
+ Updated wolfTPM submodule
2025-11-26 15:50:13 +01:00
David Garske 2546ebcaf9 Fixes for unused variables. Also repaired STM32WB55 build with PKA 2025-11-20 18:26:58 +01:00
Mattia Moffa d5b2b4728d Various STM32 TrustZone improvements
- New config flags for flash geometry
- New script to automatically set option bytes
- End of stack address fix for the STM32U5 test app
- STM32U5 support for NUCLEO-U575ZI-Q (previously only supported
  discovery board)
2025-11-20 18:00:55 +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
David Garske ecf1cb8a92 Peer review fixes. Added new WOLFBOOT_RESTORE_CLOCK option 2025-11-19 11:11:28 +01:00
David Garske c2ed553da1 Added Vorago VA416x0 wolfBoot support
Added check on image header size and sector size.
Expanded the ML-DSA testing.
2025-11-19 11:11:28 +01:00
David Garske 4d0106caee Fixes for build warnings 2025-10-30 16:31:27 +01:00
Juliusz Sosinowicz 2345138a1b Implement filesystem-based partition state access and CLI tools
- Add filesystem access implementation in HAL (`hal/filesystem.c`)
- Introduce new library_fs target and build rules for filesystem-backed partition management
- Provide example configuration for library_fs
- Add CLI application (`hal/library_fs.c`) to query and manage partitions
- Update documentation with usage instructions and build steps for the new CLI tool
- Update .gitignore
2025-10-30 16:31:27 +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
David Garske 68d28fc482
Merge pull request #609 from gojimmypi/pr-copyright
Update Copyright year to 2025
2025-10-16 15:09:03 -07:00
David Garske 301080adc4 Reverted change for H5 heap (not needed). Tracked issue down to a missing malloc fixed here: https://github.com/wolfSSL/wolfssl/pull/9305 2025-10-16 23:02:09 +02:00
David Garske 2df3768cce Fixes to support latest wolfSSL (disable KDF/PRF) 2025-10-16 23:02:09 +02:00
gojimmypi fbd8dcf8a2
Update Copyright year to 2025 2025-10-15 11:33:53 -07:00
David Garske 7f193af97d Fixes for STM32H5 TrustZone and PKCS11 store 2025-10-10 19:42:20 +02:00
David Garske 8ef41994c7
Merge pull request #604 from bigbrett/tc3xx-wolf-startup-integration
TC3xx: Replace IDE/AURIX project with new HAL module
2025-10-09 10:16:16 -07:00
Brett Nicholas 42cf7e9b70 TC3xx: Replace IDE/AURIX project with new HAL module 2025-10-08 11:03:44 -06: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
Daniele Lacamera 68e688eeb6 Updated Changelog, version 2025-08-01 13:21:47 +02:00
Brett Nicholas 1febfd906e unify global HAL names between server/client, update docs 2025-06-25 12:17:39 +02:00
Brett Nicholas c106d92a48 wolfHSM server support with X509 auth 2025-06-25 12:17:39 +02:00
David Garske 1712edc136 Add support for PowerPC 32-bit SHA256 assembly speedups. Minor fix for ELF loading to set entry point before copying sections (resolves issue with loading on top of current location). Rename elf_load_image_mmu argument `entry` to `pentry` to avoid confusion with GET_H64 macro's use of header member "entry". 2025-06-24 19:02:49 +02:00
David Garske 79cef5f605 Peer review fixes (thank you Copilot). 2025-06-16 19:05:49 +02:00
David Garske b79be86a56 Fix for `NO_SWAP_EXT=1` with encryption enabled. Peer review fixes. 2025-06-16 19:05:49 +02:00
David Garske 3d9beb2642 Cleanup the AES CTR IV. 2025-06-16 19:05:49 +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 844196981b Cleanup includes. 2025-06-16 19:05:49 +02:00
David Garske 8e6b0af105 Added Renesas RX TSIP encrypted updates support using AES CTR. Requires https://github.com/wolfSSL/wolfssl/pull/8854 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
Marco Oliverio 4154057649 hal: add missing include in hal.h 2025-06-09 16:29:31 +02:00
Brett Nicholas 7660bf66f8 Add wolfHSM cert chain verification for ECC and RSA 2025-05-27 15:42:59 -06:00
Brett Nicholas 16e5b94e9d review comments 2025-05-09 19:06:33 -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 d587a793c0 Added WOLFSSL_PUBLIC_MP to user_settings when PKCS11 is enabled. 2025-04-30 13:45:08 +02:00
Daniele Lacamera c4a3415e98 Updated bootloader version number 2025-04-30 11:49:15 +02:00