Commit Graph

204 Commits (47b61ba2eb31c26a62a069042975cbedc7f7085e)

Author SHA1 Message Date
Daniele Lacamera de4c33ee44 Propagate erase encrypt key write failures
F/1893
2026-04-08 19:50:11 +02:00
Daniele Lacamera 1442e1c8d0 Propagate encrypt key flash errors
F/1892
2026-04-08 19:50:11 +02:00
Daniele Lacamera b28a97e784 Fix PKCS11 init state typo
F/1474
2026-03-30 16:23:16 +02:00
Hideki Miyazaki 285063dc2d Move functions to RAM for flash operation
- Remove standard library as much as possible
 - Do not use memcpy before it is relocated to RAM.
 - Prefer library functions over RX intrinsics.( Compiler option change)
2026-03-21 05:52:57 +09:00
Mattia Moffa b5fab30310 Enable NSC veneers when TZEN=1, even without WOLFCRYPT_TZ 2026-03-18 22:26:32 +01:00
Mattia Moffa fcf72e008c Remove NO_DIRECT_READ_OF_ERASED_SECTOR option; write after erase instead 2026-03-18 11:53:26 +01:00
Thomas Cook 3ef8c60242 Fix XMEMSET's per correct erased byte polarity. 2026-03-18 11:53:26 +01:00
Thomas Cook 9078ede0fc Add an update test to the test-app.
Fix bugs found from the update test.
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 62dedfc446 Propagate hal_flash_write() error when writing partition magic
F/437
2026-03-12 09:28:51 +01:00
Daniele Lacamera 249e078ee5 Added missing parenthesis around macro
F/436
2026-03-10 16:55:20 +01:00
Daniele Lacamera e08ef84c34 Added parenthesis around macro
F/436
2026-03-09 11:34:50 +01:00
Paul Adelsbach 260a78e5e3 Fix string compare functions 2026-03-06 19:25:07 +01:00
Brett Nicholas 4d31ef5502 Add self-header feature with support for sim and AURIX TC3xx 2026-02-27 11:39:51 +01:00
Daniele Lacamera 43f2273a7f Added extra verify step in encrypted fallback
Using the original IV
2026-02-24 11:34:48 +01:00
David Garske ee3c313a66 Versal port cleanups 2026-01-26 13:08:50 +01:00
David Garske 7511e2e467 Fix some compiler warnings and CI build test failures 2026-01-26 11:27:39 +01:00
David Garske e1bef7ac70 PolarFire PQC (ML-DSA) testing 2026-01-26 11:27:39 +01:00
David Garske cf08819d8e Support for CUSTOM_ENCRYPT_KEY that allows customer to supply their own implementation 2026-01-01 12:52:09 +01:00
Mattia Moffa 0462e0a198 More consistent formatting 2025-12-30 11:15:41 +01:00
Mattia Moffa ce4ae39d65 Address copilot suggestions 2025-12-30 11:15:41 +01:00
Mattia Moffa 7800c364e9 Fix cppcheck complaint 2025-12-30 11:15:41 +01:00
Mattia Moffa f12d2f06b4 Add PKCS11 backend for encrypted partitions 2025-12-30 11:15:41 +01:00
David Garske afb9c84cdf Fix for uSD read to handle start that is not block aligned 2025-12-24 18:31:55 +01:00
David Garske 2546ebcaf9 Fixes for unused variables. Also repaired STM32WB55 build with PKA 2025-11-20 18:26:58 +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 3a85a27fb9 Unify the hdr_cpy (we don't need two) 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
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 6fba3b4054 Fixed unit tests 2025-10-17 12:03:42 +02: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 b1ff1e36eb Minor improvements. STM32H5 non-secure flash watermark. Fixing layout of linker script. Still getting fault on calls to smse functions like `wcs_get_random`. 2025-10-10 19:42:20 +02: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 37326c4062 Fix unit test + compile warning (CI) 2025-09-10 13:56:21 +02: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 d6ba220e55 [rp2350] Added cache in RAM for hal_flash_write 2025-09-05 14:45:35 +02:00
Daniele Lacamera 82e4950b59 Added NSC functions to facilitate updates from NS application 2025-09-05 14:12:50 +02:00
Daniele Lacamera d14045aee6 Account for flags offset when FLAGS_HOME is defined 2025-06-30 13:16:53 +02:00
Daniele Lacamera 81a63eebcd Attempt to fix double write in update_trigger
(when NVM_FLASH_WRITEONCE workaround is active)
2025-06-30 12:58:57 +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 bd179ed339 Added TSIP support to the set_key, get_key and erase_key API's. Finished full encrypted update testing on Renesas RX with TSIP. Fixed issue with `No rule to make target `NONE’` using encrypted AES. 2025-06-16 19:05:49 +02:00
David Garske 566f3b99cb Cleanup duplicate code in `aes_init`. 2025-06-16 19:05:49 +02:00
David Garske 708b797c8f Fix for Renesas RX TSIP AES CTR to make sure the wolfCrypt_Init() is called before trying to setup the crypto callback. 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 2e5bbfe273 Make sure keySize is set for RX crypto callback. 2025-06-16 19:05:49 +02:00
David Garske b07d99b57e Fix RX TSIP IV nonce. Adjust location of XALIGNED in declarations. 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