Add WOLFCRYPT_TZ_WOLFHSM TrustZone engine for STM32H5#769
Conversation
e312cbb to
0c7b556
Compare
c86b935 to
2c6827d
Compare
24de72f to
1f1a3ac
Compare
a03e6e5 to
d735665
Compare
74e53e9 to
51140c1
Compare
0a1781a to
91c39c4
Compare
bigbrett
left a comment
There was a problem hiding this comment.
@aidangarske a few questions
danielinux
left a comment
There was a problem hiding this comment.
Non-blocking issue:
The three cmse_check_address_range() calls use CMSE_AU_NONSECURE, whereas the sibling veneers fwtpm_callable.c and pkcs11_callable.c use CMSE_NONSECURE (= CMSE_AU_NONSECURE | CMSE_MPU_NONSECURE).
All three correctly reject secure-world pointers, so this isn't a bug, also because NO_MPU=1 . But once an NS MPU is ever configured, this veneer alone won't enforce NS-MPU permissions on the buffer.
Note for later: consider aligning the flag across the three TZ veneers and add a one-line note on the chosen semantics so it's a deliberate decision rather than an accidental divergence.
Merging as is for now.
|
@aidangarske This has conflicts with master branch now: please rebase. Also perhaps consider fixing the CMSE_AU_NONSECURE / CMSE_NONSECURE minor remark above |
32ef710 to
b9bd6da
Compare
Description
WOLFCRYPT_TZ_WOLFHSM=1a fourth TrustZone engine for STM32H5alongside PKCS11, PSA, and fwTPM. New config:
config/examples/stm32h5-tz-wolfhsm.config.the non-secure application through a single NSC veneer
(
wcs_wolfhsm_transmit). The non-secure app uses the standardwolfCrypt API; operations through
WH_DEV_IDroute to the secureside. Keys never leave the secure world.
whFlashCbadapter(
src/wolfhsm_flash_hal.c) overhal_flash_*, mirroringpsa_store.c's sector-cached read-modify-erase-write pattern.Two-partition journaling in the existing keyvault region.
WOLFHSM_SERVER_OBJS/WOLFHSM_CLIENT_OBJSvariables avoidobject-list duplication with the existing AURIX/sim wolfHSM lanes.
.github/workflows/trustzone-emulator-tests.yml:m33mu first-boot/second-boot persistence test asserting CommInit,
RNG, SHA256, AES, and keystore restore across reset.
tools/unit-tests/unit-wolfhsm_flash_hal.ccovers bounds, alignment, multi-sector, and write-failure paths.
docs/wolfHSM.md+ wolfHSM section indocs/STM32-TZ.md.Notes
lib/wolfHSMsubmodule pin is not bumped in this PR. The wolfHSMPR (
port/stmicro/stm32-tzNSC bridge transport) lands first; thepin bump will follow in a small standalone PR.
Test plan
WOLFHSM_TZ_TEST_PASSover UART