Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c6a7ebb
Skip asymmetric encryption in the Secure PSA service without RSA
aidangarske Nov 20, 2026
cceed12
Build one copy of wolfCrypt's misc helpers in the Secure PSA image
aidangarske Nov 19, 2026
eeb60cd
Check the caller owns the named key once before dispatching a PSA call
aidangarske Nov 20, 2026
c2ef490
Run P-256 on wolfPSA's direct SP path outside the compat profile
aidangarske Nov 21, 2026
b75a017
Add WT_AEAD for GCM or CCM, defaulting to CCM in lean and symmetric
aidangarske Nov 20, 2026
f23205a
Update the Secure PSA sizes after the direct P-256 and CCM changes
aidangarske Nov 30, 2026
49f5f87
Size the Secure PSA crypto stack and data band from measured use
aidangarske Nov 30, 2026
e91f292
Refresh the Secure PSA and interface sizes on the current main
aidangarske Nov 30, 2026
18d2628
Run the vault CCM on wolfPSA's streaming CCM in the Secure PSA image
aidangarske Nov 30, 2026
245eff6
Run the vault GCM on wolfPSA's streaming GCM in the Secure PSA image
aidangarske Nov 30, 2026
dd846e8
Leave SP 800-108 out of the non-compat Secure PSA profiles
aidangarske Nov 24, 2026
b98e674
Pin wolfPSA with the TLS 1.2 PRF compiled only when wolfCrypt has it
aidangarske Nov 30, 2026
bd1fc6d
Leave CCM* without a tag out of the non-compat Secure PSA profiles
aidangarske Nov 30, 2026
1679d3e
Pin wolfPSA with the wolfCrypt error map as a table
aidangarske Nov 30, 2026
54085da
Name every build level tiny, small, default or extended
aidangarske Nov 30, 2026
f8c926c
Build tiny with an HMAC attestation key and no ECC in the image
aidangarske Nov 30, 2026
a568042
Run tiny on M33MU with a COSE_Mac0 check across an attestation restart
aidangarske Nov 30, 2026
f020010
Drop the attestation partition's crypto service dependency under an H…
aidangarske Nov 25, 2026
ceb501b
Re-measure the documented Secure image sizes on every port
aidangarske Nov 30, 2026
720ee1b
Read the manifest generator arguments with the host preprocessor in t…
aidangarske Nov 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ An accepted upload queues analysis; results appear after Coverity processes it.
|------|---------|---------|
| **Fast (per-PR)** | every PR; push to main | host unit suites, ISO C99, house style, bare-scope scan, Arm PSA-FF conformance, cross-compile, compiler matrix, sanitizers, valgrind, integrations, core/port split guard |
| **M33MU smoke** | every PR | each port not marked label only, on both crypto engines (its smoke tier in `port.json`) |
| **M33MU full** | PR labels `ci:all`, `ci:m33mu` or a port's own label; push to main; `cron: 0 8 * * *`; `workflow_dispatch` (port input) | every scenario of that port on both engines (see below) |
| **M33MU all** | PR labels `ci:all`, `ci:m33mu` or a port's own label; push to main; `cron: 0 8 * * *`; `workflow_dispatch` (port input) | every scenario of that port on both engines (see below) |

The M33MU workflow (`m33mu.yml`) is label-selected the way wolfProvider's
`pr-osp-select.yml` is: a `select` job checks the routing table
Expand All @@ -50,8 +50,8 @@ rendered wolfBoot-style as `M33MU / <device>_<scenario>_<engine>` (for
example `M33MU / stm32h563_confboot_native`). The scenario groups per port
and tier live in `tests/target/lib/scenario_matrix.py`, which `make
test-target` also reads. Every group also runs on a build profile: jobs on
the lean `default` image carry `_default` before the engine (for example
`stm32h563_positive_default_native`), jobs without it build the `full`
the `default` profile carry `_default` before the engine (for example
`stm32h563_positive_default_native`), jobs without it build the `extended`
profile. The table below is a representative slice:

| Check name | Scenario key | What it proves |
Expand Down
123 changes: 120 additions & 3 deletions .github/workflows/cross-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ jobs:
python3 tools/secure_ram.py --base-max 45728 \
build_budget_$target/wolftrust.map
done
- name: Build every port's full-profile secure image (every engine)
- name: Build every port's extended-profile secure image (every engine)
if: matrix.leg != 'common'
run: |
flags="$(. tests/target/lib/profile.sh; scenario_profile_flags full)"
flags="$(. tests/target/lib/profile.sh; scenario_profile_flags extended)"
for target in $WT_CI_PORT; do
for engine in $(python3 tests/target/lib/scenario_matrix.py --port $target --get build.engines); do
# shellcheck disable=SC2086
Expand Down Expand Up @@ -217,12 +217,21 @@ jobs:
if: matrix.leg != 'common'
run: |
for target in $WT_CI_PORT; do
for profile in compat standard lean symmetric; do
for profile in extended default small tiny; do
dir=build_spsa_${target}_$profile
make TARGET=$target WT_SECURE_PSA=1 WT_SECURE_PSA_PROFILE=$profile \
secure-image TOOLPREFIX=arm-none-eabi- BUILD_DIR=$dir
grep -qx 'WT_SECURE_PSA=1' $dir/secure_build_mode.stamp
grep -qx "WT_SECURE_PSA_PROFILE=$profile" $dir/secure_build_mode.stamp
cfg=$dir/wolfpsa_cfg/crypto_config_generated.h
if [ "$profile" = extended ]; then
grep -qE '^#define PSA_WANT_ALG_SP800_108_COUNTER_HMAC\b' $cfg
grep -qE '^#define PSA_WANT_ALG_CCM_STAR_NO_TAG\b' $cfg
elif grep -qE '^#define PSA_WANT_ALG_(SP800_108_COUNTER_(HMAC|CMAC)|CCM_STAR_NO_TAG)\b' $cfg ||
arm-none-eabi-nm $dir/wolftrust.elf | grep -qi sp800_108; then
echo "FAIL: $profile still carries SP 800-108 or CCM*" >&2
exit 1
fi
done
done
- name: Verify bad Secure PSA settings stop the build
Expand All @@ -240,6 +249,50 @@ jobs:
WT_PSA_KEY_SLOTS=8 WT_PSA_OP_SLOTS=4 secure-image \
TOOLPREFIX=arm-none-eabi- BUILD_DIR=build_spsa_sizes
grep -qx 'WT_PSA_SIZES=8192/8/4/' build_spsa_sizes/secure_build_mode.stamp
# small and tiny offer one PSA AEAD: CCM unless WT_AEAD=gcm
for aead in "" gcm ccm; do
dir=build_aead_small_${aead:-default}
used=${aead:-ccm}
make WT_SECURE_PSA=1 WT_SECURE_PSA_PROFILE=small WT_AEAD=$aead \
secure-image TOOLPREFIX=arm-none-eabi- BUILD_DIR=$dir
grep -qx "WT_AEAD=$used" $dir/secure_build_mode.stamp
if [ "$used" = ccm ]; then want=CCM; drop=GCM; else want=GCM; drop=CCM; fi
cfg=$dir/wolfpsa_cfg/crypto_config_generated.h
arm-none-eabi-nm $dir/wolftrust.elf > $dir/syms.txt
grep -qE "^#define PSA_WANT_ALG_$want\b" $cfg
grep -qi " wc_Aes$want" $dir/syms.txt
if grep -qE "^#define PSA_WANT_ALG_$drop\b" $cfg || grep -qi " wc_Aes$drop" $dir/syms.txt; then
echo "FAIL: small with WT_AEAD=$used still carries $drop" >&2
exit 1
fi
done
# With no Secure PSA AEAD to share, the vault keeps GCM
for profile in small tiny; do
make WT_SECURE_PSA=0 WT_PROFILE=$profile secure-image \
TOOLPREFIX=arm-none-eabi- BUILD_DIR=build_aead_nopsa_$profile
grep -qx 'WT_AEAD=gcm' build_aead_nopsa_$profile/secure_build_mode.stamp
done
make WT_SECURE_PSA=1 WT_AEAD=ccm secure-image TOOLPREFIX=arm-none-eabi- \
BUILD_DIR=build_aead_compat_ccm
grep -qx 'WT_AEAD=ccm' build_aead_compat_ccm/secure_build_mode.stamp
for want in GCM CCM; do
grep -qE "^#define PSA_WANT_ALG_$want\b" \
build_aead_compat_ccm/wolfpsa_cfg/crypto_config_generated.h
done
for mode in "WT_ENGINE=hsm" "WT_SECURE_PSA=0"; do
# shellcheck disable=SC2086
make $mode WT_AEAD=ccm secure-image TOOLPREFIX=arm-none-eabi- \
BUILD_DIR=build_aead_mode
grep -qx 'WT_AEAD=ccm' build_aead_mode/secure_build_mode.stamp
arm-none-eabi-nm build_aead_mode/wolftrust.elf | grep -q ' wc_AesCcm'
rm -rf build_aead_mode
done
if make WT_AEAD=chacha BUILD_DIR=build_spsa_bad secure-image \
TOOLPREFIX=arm-none-eabi- 2> spsa.err; then
echo "FAIL: WT_AEAD=chacha built" >&2
exit 1
fi
grep -q 'WT_AEAD' spsa.err
for bad in "WT_PSA_OP_SLOTS=1x" "WT_PSA_OP_SLOTS=300" "WT_PSA_POOL_BYTES=1024"; do
# shellcheck disable=SC2086
if make WT_SECURE_PSA=1 $bad BUILD_DIR=build_spsa_bad \
Expand All @@ -249,6 +302,70 @@ jobs:
fi
grep -qE 'WT_PSA_(OP_SLOTS|POOL_BYTES)' spsa.err
done
- name: Build every port's tiny profile with no ECC in the image
if: matrix.leg != 'common'
run: |
ecc='[0-9a-f]+ . (sp_256_|sp_ecc_|wc_ecc_|wolfPSA_P256_|wc_CoseSign1)'
for target in $WT_CI_PORT; do
dir=build_tiny_$target
make TARGET=$target WT_PROFILE=tiny secure-image \
TOOLPREFIX=arm-none-eabi- BUILD_DIR=$dir
grep -qx 'WT_ATTEST_KEY=hmac/1' $dir/secure_build_mode.stamp
grep -qx 'WT_VAULT_ECC=0' $dir/secure_build_mode.stamp
arm-none-eabi-nm $dir/wolftrust.elf > $dir/syms.txt
grep -q ' wc_CoseEatPsaToken_CreateMac0' $dir/syms.txt
if grep -qE "$ecc" $dir/syms.txt; then
echo "FAIL: $target tiny still links ECC" >&2
exit 1
fi
done
- name: Verify each ECC feature flag (WT_ATTEST_KEY, WT_VAULT_ECC) and what tiny saves
if: matrix.leg == 'common'
run: |
ecc='[0-9a-f]+ . (sp_256_|sp_ecc_|wc_ecc_|wolfPSA_P256_|wc_CoseSign1)'
flash() { arm-none-eabi-size "$1" | awk 'NR == 2 { print $1 + $2 }'; }
# Either flag alone brings ECC back, and each works on any profile.
for args in "WT_PROFILE=tiny WT_ATTEST_KEY=ecc" "WT_PROFILE=tiny WT_VAULT_ECC=1" \
"WT_ATTEST_KEY=hmac" "WT_VAULT_ECC=0" "WT_ATTEST_KEY=hmac WT_VAULT_ECC=0"; do
dir=build_eccflag
# shellcheck disable=SC2086
make $args secure-image TOOLPREFIX=arm-none-eabi- BUILD_DIR=$dir
for flag in $args; do
case $flag in
WT_ATTEST_KEY=*) grep -qx "$flag/1" $dir/secure_build_mode.stamp ;;
WT_VAULT_ECC=*) grep -qx "$flag" $dir/secure_build_mode.stamp ;;
esac
done
arm-none-eabi-nm $dir/wolftrust.elf | grep -qE "$ecc"
case $args in
"WT_PROFILE=tiny WT_ATTEST_KEY=ecc") with_ecc=$(flash $dir/wolftrust.elf) ;;
esac
rm -rf $dir
done
# The cut is the point of the profile: it must stay worth 8 KiB.
make WT_PROFILE=tiny secure-image TOOLPREFIX=arm-none-eabi- BUILD_DIR=build_eccflag
tiny=$(flash build_eccflag/wolftrust.elf)
rm -rf build_eccflag
echo "tiny $tiny bytes, with an ECC attestation key $with_ecc bytes"
test $((tiny + 8192)) -le "$with_ecc" || \
{ echo "FAIL: tiny without ECC saves less than 8 KiB" >&2; exit 1; }
# A product build has no development key until its port supplies one.
if make WT_PROFILE=tiny WT_ATTEST_DEV_KEY=0 secure-image \
TOOLPREFIX=arm-none-eabi- BUILD_DIR=build_eccflag 2> eccflag.err; then
echo "FAIL: tiny linked with no attestation key source" >&2
exit 1
fi
grep -q 'wt_port_attest_hmac_key' eccflag.err
for bad in "WT_ATTEST_KEY=rsa" "WT_VAULT_ECC=2" "WT_ATTEST_DEV_KEY=2" \
"WT_ENGINE=hsm WT_ATTEST_KEY=hmac" "WT_ENGINE=hsm WT_VAULT_ECC=0"; do
# shellcheck disable=SC2086
if make $bad BUILD_DIR=build_eccflag secure-image \
TOOLPREFIX=arm-none-eabi- 2> eccflag.err; then
echo "FAIL: $bad built" >&2
exit 1
fi
grep -qE 'WT_(ATTEST_KEY|VAULT_ECC|ATTEST_DEV_KEY)' eccflag.err
done
- name: Verify the Secure PSA guest links the client and no wolfPSA
if: matrix.leg != 'common'
run: |
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ and [docs/Building.md](docs/Building.md).
| `make test` | host suites, registry and scenario self-tests, the assertion mutation test, the scaffold self-test, the guards, the provisioning gates, the hardware runner self-tests | the `wolftrust-ci` image the workflows pin (`docker/wolftrust-ci/`), which carries `expect` for the typed provisioning cases |
| `make c99-check CC=gcc`, `sh scripts/check_house_style.sh`, `python3 scripts/check-empty-brace-scopes.py` | the coding-standard gates | any host |
| `make test-compilers`, `make test-sanitize`, `make test-valgrind` | the host suites under each compiler and checker | any host |
| `make test-target TARGET=<soc>` (`WT_TIER=full`, `WT_ENGINE=hsm`) | M33MU emulator scenarios; `tests/target/run_target.sh <soc> <scenario>` runs one | the port's `wolfboot-ci-m33mu` image from docs/Ports.md; NXP ports also need the MCUXpresso SDK (see the guide) |
| `make test-target TARGET=<soc>` (`WT_TIER=all`, `WT_ENGINE=hsm`) | M33MU emulator scenarios; `tests/target/run_target.sh <soc> <scenario>` runs one | the port's `wolfboot-ci-m33mu` image from docs/Ports.md; NXP ports also need the MCUXpresso SDK (see the guide) |
| `make test-hardware TARGET=<soc>` | the board scenarios; writes flash and resets the board | the host that owns the probe |

`make test` stops at its first failing step. The emulator and hardware
Expand Down
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ endif
ifeq ($(wildcard mk/arch-$(ARCH).mk),)
$(error unsupported secure build architecture ARCH=$(ARCH))
endif
# make test-target runs the profile asked for, or default then extended.
WT_TEST_PROFILES ?= $(if $(filter command line environment,$(origin WT_PROFILE)),$(WT_PROFILE),default extended)
include mk/profile.mk
include mk/target-$(TARGET).mk
include mk/layout.mk
include mk/arch-$(ARCH).mk
Expand Down Expand Up @@ -85,24 +88,21 @@ c99-check:
EXTRA_CFLAGS="$(C99_CFLAGS)"

# M33MU scenarios for one registered port (TARGET): WT_TIER=smoke (default) or
# full, from its port.json. WT_PROFILE picks the build profile: default (the
# lean image make builds with no options), full (every add-on) or both, the
# default here, which runs default then full. Skips, never passes, without an
# emulator; runs in the wolfboot-ci-m33mu container, never bare-metal.
# all, from its port.json, on each of WT_TEST_PROFILES. Skips, never passes,
# without an emulator; runs in the wolfboot-ci-m33mu container, never bare-metal.
WT_TIER ?= smoke
WT_PROFILE ?= both
WT_SCENARIOS = $(shell python3 tests/target/lib/scenario_matrix.py \
--port $(TARGET) --tier $(WT_TIER) --engine $(WT_ENGINE) \
--profile $(1) --flat)
test-target:
@case "$(WT_PROFILE)" in default|full|both) ;; *) \
echo "unsupported WT_PROFILE='$(WT_PROFILE)' (want default, full or both)" >&2; \
exit 2 ;; esac
@for p in $(WT_TEST_PROFILES); do case "$$p" in default|extended) ;; *) \
echo "unsupported test profile '$$p' (want default or extended)" >&2; \
exit 2 ;; esac; done
@if ! tests/target/detect_m33mu.sh $(TARGET) >/dev/null 2>&1; then \
echo "SKIP: FF-M target scenarios ($$(tests/target/detect_m33mu.sh $(TARGET) 2>&1))"; \
else \
$(foreach p,$(if $(filter both,$(WT_PROFILE)),default full,$(WT_PROFILE)),\
WT_PROFILE=$(p) WT_SUITE_LOG_DIR=$(if $(filter both,$(WT_PROFILE)),logs/$(p),logs) \
$(foreach p,$(WT_TEST_PROFILES),\
WT_PROFILE=$(p) WT_SUITE_LOG_DIR=$(if $(word 2,$(WT_TEST_PROFILES)),logs/$(p),logs) \
tests/target/run_suite.sh $(TARGET) \
$(call WT_SCENARIOS,$(p)) || exit 1;) \
fi
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ make test

The Secure build produces `build/wolftrust.elf`,
`build/wolftrust.bin`, and `build/secure_cmse_implib.o`. `make` builds the
lean default image: isolation level 3, one Non-secure guest, and the Crypto,
`default` profile: isolation level 3, one Non-secure guest, and the Crypto,
ITS, Protected Storage and attestation services. Add-ons such as a second
guest (`WT_MAX_GUESTS=2`) or firmware update (`WT_FWU=1`) are one Make
variable each; see [Build profiles](docs/Macros.md#build-profiles).
Expand Down Expand Up @@ -148,7 +148,7 @@ make test-hardware TARGET=stm32h563
make test-hardware TARGET=mcxn947
```

`make test-target` runs the port's smoke tier under M33MU (`WT_TIER=full` for
`make test-target` runs the port's smoke tier under M33MU (`WT_TIER=all` for
every scenario): the STM32H563 default skips explicitly when M33MU is
unavailable, and `TARGET=mimxrt700` or `TARGET=mcxn947` builds its pinned
emulator and wolfBoot first stage itself.
Expand Down
2 changes: 1 addition & 1 deletion docs/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ enforce that policy.
The only currently supported and validated reference implementation combines
the Armv8-M adapter with the STM32H563 port. Its default configuration runs
one Non-secure guest on one Cortex-M33 (two with `WT_MAX_GUESTS=2`, as the
`full` build profile does) and exposes Secure services only through FF-M IPC. These are current reference-port choices. The common policy and
`extended` build profile does) and exposes Secure services only through FF-M IPC. These are current reference-port choices. The common policy and
service design is intended for reuse, but current internal contracts still
contain Armv8-M-specific types and assumptions.

Expand Down
8 changes: 5 additions & 3 deletions docs/Building.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ reference is the mutable `main` branch, not a pinned workspace.
make
```

This builds the lean default image: isolation level 3, one Non-secure image,
This builds the `default` profile: isolation level 3, one Non-secure image,
Crypto, Internal Trusted Storage, Protected Storage and Initial Attestation,
with the manifest checked at build time. Turn an add-on back on with its Make
variable, alone or together:
Expand All @@ -47,7 +47,9 @@ make WT_FWU=1 secure-image # PSA Firmware Update
make WT_MANIFEST_RUNTIME_CHECK=1 secure-image # boot-time manifest check
make WT_SHA256_FAST=1 secure-image # unrolled SHA-256 transform
make WT_ENGINE=hsm secure-image # the wolfHSM engine
make WT_MAX_GUESTS=2 WT_MANIFEST_RUNTIME_CHECK=1 WT_FWU=1 WT_SHA256_FAST=1 secure-image # full profile
make WT_PROFILE=extended secure-image # every add-on, extended PSA set
make WT_PROFILE=small secure-image # one AEAD, no AES decryption
make WT_PROFILE=tiny secure-image # no ECC: HMAC attestation key, no vault P-256
```

[Macros](Macros.md#build-profiles) lists what each add-on brings back and its
Expand Down Expand Up @@ -153,7 +155,7 @@ Record the LTO setting with published size results. [Footprint](Footprint.md)
lists the measured sizes and the options that change them.

The default image runs one guest; `WT_MAX_GUESTS=2` adds the second guest the
reference two-guest demos use (the target runners pass it through the `full`
reference two-guest demos use (the target runners pass it through the `extended`
profile). Changing
guest addresses or sizes also requires matching manifest, guest linker,
emulator-load, flash, and measurement-record settings. See
Expand Down
Loading
Loading