Add a generic secure application handoff for authenticated boot - #906
Open
aidangarske wants to merge 2 commits into
Open
aidangarske wants to merge 2 commits into
aidangarske wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Three unresolved moderate findings remain regarding header coupling, interrupt masking, and updater-path coverage.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
What changed in this PR
Adds an opt-in TrustZone-M secure application handoff with authenticated SHA-256 measurement and lifecycle metadata, including STM32H5 support.
Changes:
- Adds the secure handoff record and measured Secure-state boot path.
- Adds configuration validation, lifecycle handling, documentation, and tests.
- Adds STM32H5 reference configuration and TrustZone integration.
| File | Summary |
|---|---|
tools/unit-tests/unit-secure-handoff.c |
Tests handoff record construction and lifecycle mapping. |
tools/unit-tests/test-secure-handoff-config.sh |
Tests configuration validation and stack settings. |
tools/unit-tests/Makefile |
Registers secure handoff tests. |
tools/config.mk |
Adds secure handoff configuration variables. |
src/update_flash.c |
Builds and publishes the handoff record; moderate finding, 1 vote. |
src/boot_arm.c |
Adds Secure-state application branching; moderate finding, 1 vote. |
options.mk |
Adds secure handoff validation and build settings. |
Makefile |
Adjusts STM32H5 build targets. |
include/wolfboot/wolfboot.h |
Adds secure-app configuration checks. |
include/wolfboot/secure_handoff.h |
Defines the handoff ABI; moderate finding, 2 votes. |
hal/stm32h5.h |
Adds STM32H5 product-state definitions. |
hal/stm32h5.c |
Implements lifecycle reporting and handoff setup. |
hal/stm32h5_lifecycle.h |
Maps STM32H5 states to PSA lifecycle values. |
hal/stm32_tz.c |
Preserves Secure memory and flash regions. |
docs/secure_app_handoff.md |
Documents configuration, record format, and porting. |
config/examples/stm32h5-tz-wolftrust.config |
Adds the STM32H5 reference configuration. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
aidangarske
force-pushed
the
secure-app-handoff
branch
from
September 19, 2026 02:26
dd076c4 to
0ee0a5b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

on trustzone-m devices wolfboot currently can only hand control to a non-secure applciation. There is no built-in way to launch a signed Secure-state runtime (a secure OS or TF-M-style secure world) and pass it a trustworthy measurement of the image that was booted, so anyone needing that has had to patch wolfBoot out of tree. This adds WOLFBOOT_SECURE_APP, a target-independent measured handoff that authenticates the image writes its SHA-256 measurement to a known secure-RAM address for the runtime to consume, and jumps while staying in Secure state. It works on any Armv8-M TrustZone target through config alone.
Non-secure app, staying in Secure state.
PSA lifecycle, image version, SHA-256 measurement) to WOLFBOOT_SECURE_HANDOFF_ADDRESS.
SIGN=NONE / WOLFBOOT_NO_SIGN / WOLFBOOT_SKIP_BOOT_VERIFY are rejected.
the secure app Secure across the jump.
product state and debug auth status).
crypto/storage/attestation, isolation negatives, anti-rollback, boot-and-update).