Commit Graph

331 Commits (8ec8443345f497232edd67e0de0c034e0df71fb6)

Author SHA1 Message Date
David Garske 88984858d5 Peer review fixes (thanks Jack) 2026-08-24 12:47:34 +02:00
David Garske 71b855f7b5 cm4: add wolfCrypt FIPS 140-3 support + CI, SDHCI unit test, review fixes 2026-08-24 12:47:34 +02:00
David Garske 5c07c3797e zynq: provide hal_get_timer_us for BOOT_BENCHMARK/UPDATE_DISK builds without MMU, avoiding libgcc 128-bit division in the test-app link 2026-08-21 07:17:01 +02:00
Sameeh Jubran 919de4395a sbom: run the wolfGlass drift check on every pull request
wolfGlass is public, so actions/checkout resolves the pinned revision with
the default token.  Requiring WOLFGLASS_TOKEN made the job skip itself
whenever the secret was absent, which is every fork pull request, so the
one guard that holds tools/sbom/ to its pin was off for exactly the
contributors whose vendored copy nobody has reviewed.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 1a067c23fb sbom: fail when an object maps to no source, instead of shrinking the SBOM
SBOM_SRCS runs the object list through $(wildcard), so a source that is
not on disk disappears before the driver sees it. The driver's own
--skip-missing warning then has nothing left to report, which is why it
never fires on the Make path that every embedded user takes.

The result is a document that under-reports the image with no diagnostic
anywhere. A sim-tpm build without lib/wolfTPM checked out silently loses
all eight tpm2*.c sources, and validate_sbom.py accepts the result even
though the captured configuration still records WOLFBOOT_TPM=1.

Compare the two lists instead. An object that maps to neither a .c nor a
.S on disk means a submodule or a vendor SDK is absent, so stop and name
the objects on stderr. SBOM_ALLOW_MISSING=1 accepts the partial document
for the cases where the SDK genuinely cannot be present, and still lists
what is missing; imx_rt is one, because it compiles three MCUXpresso
drivers from outside the source tree.

Every other example config either passes or names only submodule paths
that CI checks out, so no job needs the escape hatch.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 9c23c82bb4 sbom: build each cross-target SBOM for the target its config selects
The cross_targets matrix lists config file names, and the step passed the
same string as TARGET. For four of the seven entries that is not the
target the config selects: nrf52840.config sets TARGET=nrf52,
imx-rt1060.config sets imx_rt, nxp-t1040.config sets nxp_t1040, and
renesas-rx65n.config sets rx65n.

TARGET on the command line beats the config, so the build asked for
hal/nrf52840.o, whose source does not exist. SBOM_SRCS filters the source
list through $(wildcard), which dropped it, and the job stayed green
while publishing an SBOM for a bootloader with no target HAL at all:
29 sources, hal.c present, nrf52.c absent.

Drop the TARGET override and let the config decide, which is what the
documented invocation already does. nrf52840 now records 30 sources with
hal/nrf52.c among them, and the document is named for the real target.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 6d141bdafd sbom: pin the vendored wolfGlass copy to a revision that resolves
tools/sbom/.wolfglass-rev named 1bfcf4f1a293ba09f0ff6d67904dca09ee8eb6d7,
which exists in no repository. The vendored content is wolfGlass
d34a906638444b6990218a49927bcebafc5a539b: tools/wolfglass-sync --check
against that revision reports every file identical and only the pin
itself as drift.

A bare SHA with nothing checking it is also how a 1803-line vendored
generator drifts from the copy wolfSSL controls, or carries a local
patch, without anything noticing. Add a job that checks wolfGlass out at
the pinned revision and runs its own tools/wolfglass-sync --check, which
compares every vendored file against share/ and the pin against HEAD. An
unresolvable revision now fails that job rather than sitting in the tree.

A fork PR has no token to read wolfGlass with, so the job reports a
notice and passes there; the run on wolfSSL/wolfBoot is the gate.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran c0c8cf2e4f sbom: re-vendor wolfGlass tip and harden Make-path SBOM tooling
Sync tools/sbom to wolfGlass 9bdf5b7: document --cflags -D-only
behavior, add WOLFSSL_DIR/version.h --dep-version fallback with correct
$$$$ expansion, and teach validate_sbom.py --min-properties. CI Make
path checks now require a non-empty property set so empty captures
cannot pass.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 66f6701a02 Vendor wolfGlass SBOM tooling and switch wolfBoot to it
Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran b4d425edb5 sbom: expand CI to prove toolchain neutrality and cross-target coverage
The SBOM canary now guards the properties customers rely on, not only
that each route runs.

sbom_canary job adds three checks:
  * Toolchain neutrality - build the same sim config with gcc and with
    clang and require a byte-identical CycloneDX and SPDX result. The
    driver captures configuration with the host compiler and a source
    list, so the cross-toolchain that builds the firmware does not change
    the SBOM. clang, LLVM and vendor compilers need no separate front end.
  * Reproducibility - build the same config from a second absolute path
    and require an identical SBOM, so no build path leaks into the output.
  * Path scrub in a real build - build rp2350 with an absolute
    PICO_SDK_PATH and assert the path is redacted while the macro key is
    kept. This exercises the scrub through arch.mk, not a synthetic line.

New cross_targets job runs make sbom for a spread of architectures with
no IDE and no cross-toolchain installed: stm32h7, nrf52840, imx-rt1060
and sama5d3 (Arm), nxp-t1040 (PowerPC), renesas-rx65n (Renesas RX) and
hifive1 (RISC-V). The driver never calls the cross compiler, so each
target produces a valid SBOM on a plain runner. This proves the "any
target, any toolchain, no hardware" guarantee.

Every produced document is checked with validate_sbom.py and uploaded as
a build artifact.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 142de77ed3 sbom: generate SBOMs from every wolfBoot build system
wolfBoot ships as source. Users build it in many ways. Before this
change, only the plain Make build could make an SBOM. So a user could not
make an SBOM for the build that the user runs.

This change adds one shared engine (tools/scripts/wolfboot-sbom.sh, which
calls wolfSSL gen-sbom) and a front end for each build system. Every
build makes a CycloneDX 1.6 and SPDX 2.3 document. The engine captures
the configuration with the host compiler, so the SBOM is the same for
GCC, Clang, LLVM, IAR, armcl, CCRX, and XC32.

Routes:
  - Make, arch.mk, and vendor SDKs: make sbom TARGET=<t> SIGN=<a>
  - CMake and the Pico SDK: cmake --build <dir> --target sbom
  - IAR Embedded Workbench: ide-sbom/iar_sbom.py
  - Any IDE with a compilation database: ide-sbom/compdb_sbom.py
  - TI CCS, MPLAB X, Renesas, Xilinx: ide-sbom/route_through_sbom.sh
  - Per-HAL component: make sbom-hal TARGET=<t>
  - Zephyr module: ide-sbom/zephyr_sbom.py

Make the SBOM reproducible. The captured macros can hold an absolute host
path. For example, arch.mk passes -DPICO_SDK_PATH=$(PICO_SDK_PATH). The
driver now redacts each absolute path but keeps the macro name, so the
configuration record stays complete. Add --no-scrub for debug.

Add a validator (ide-sbom/validate_sbom.py) and a CI canary
(.github/workflows/test-sbom.yml) that runs and validates every route.
The canary also checks that no host path leaks into the SBOM.

Add docs/SBOM.md. The tools are product-neutral by design, so they can be
shared across wolfSSL products later without logic changes.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Brett Nicholas 6ba2172695 Add additional test coverage for monolithic self updates with asymmetric partition sizing 2026-08-19 17:47:48 +02:00
David Garske d42109c843
Merge pull request #862 from danielinux/fenrir-fixes-2026-08-18
Fenrir fixes 2026 08 18
2026-08-18 12:12:50 -07:00
Daniele Lacamera 640ee478e4 ci: cover the raspi3 encrypted artifact pipeline
test-configs.yml already builds this config; what nothing covers is the
keytools half of the documented procedure -- signing and encrypting an
AArch64 payload and assembling the boot image. That is where the wrong
key size in the docs hid, so build it in CI.

Builds with DEBUG_UART=1, the mode the docs tell users to run and one
that did not compile until now. It stops short of booting: the target
emits nothing on the console under QEMU, so there is nothing to assert.
2026-08-18 20:04:55 +02:00
David Garske f0ea7fe484 ci: build zynqmp with FIT_RAMDISK to cover the src/fdt.c initrd paths 2026-08-18 11:04:53 +02:00
David Garske 27edd0f5e7 tegra234: bare-metal BL33 target with verified EL2->EL1 + device-tree boot 2026-08-18 11:01:45 +02:00
Daniele Lacamera db8e768bbc aarch64: link the ARM ChaCha port when ChaCha is selected
Under WOLFSSL_ARMASM, chacha.c calls wc_chacha_crypt_bytes(), which
arch.mk never adds for AArch64 -- it only pulls in the aes/sha ports.
Any AArch64 build using ChaCha failed to link. Add the object in
options.mk, where ChaCha is selected.

Also add a ChaCha variant of the zynqmp_sdcard ENCRYPT build to CI.
2026-08-11 13:59:06 +02:00
Daniele Lacamera 4726dce42b update_disk: use wc_ForceZero() in the DISK_ENCRYPT helpers
ForceZero() is only visible in libwolfboot.c, which pulls in misc.c
inline; update_disk.c called it without a declaration, so any config with
disk encryption failed to build. Use the exported wc_ForceZero() from
memory.o instead, which is always linked.

Add a zynqmp_sdcard ENCRYPT build job to CI, the only one that compiles
these paths.
2026-08-11 13:59:06 +02:00
David Garske 34941079e1 Add aarch64_efi target: wolfBoot as an AArch64 UEFI application 2026-08-10 21:03:50 +02:00
Aidan Garske db0801b9b4 Add wolfCOSE DICE attestation 2026-08-06 09:44:52 +02:00
David Garske e718eed709 PolarFire SoC: LPDDR4 DDR init for MPFS250T Video Kit (M-Mode) 2026-08-03 12:27:22 +02:00
Mattia Moffa 3468e965e7 Add MAX32666 CI 2026-07-31 14:33:56 +02:00
David Garske 40e732e57c ci: build Renesas RX example configs 2026-07-30 15:32:31 +02:00
David Garske d66d9b119f zynq: add optional ZynqMP PHY init over GEM MDIO 2026-07-30 15:26:01 +02:00
David Garske 464f1eeae5
Merge pull request #828 from bigbrett/remove-custom-tlv-limit
support for large and file-backed custom TLVs
2026-07-23 08:48:30 -07:00
David Garske 1ceaef3eee zynqmp: wolfBoot ZynqMP FSBL with signed FIT Linux boot and EL3 security (eFuse/PUF/AES-CSU) 2026-07-22 11:56:40 +02:00
Brett Nicholas 235bd820e6 Add support for auxillary algorithms and cert chain/TPM usage 2026-07-22 11:47:16 +02:00
Brett Nicholas 0d5eec0d6f add test coverage for large and file-backed tlvs 2026-07-21 16:33:19 -06:00
Daniele Lacamera 3744aae33d ci: add stm32u5 dual-bank swap fallback test on m33mu
Add a GitHub Actions workflow covering the DUALBANK_SWAP fallback
scenario fixed by the previous commit, running on the m33mu emulator
(wolfboot-ci-m33mu image, which models the physical-bank BKER/SWAP_BANK
semantics of the STM32U5 flash controller).

The test drives three boots in a single emulator session with the
stm32u5-nonsecure-dualbank config:

  1. wolfBoot verifies a valid v2 image in the UPDATE partition,
     activates SWAP_BANK and reboots;
  2. the v2 app, now running from physical bank 2, stages a fake v3
     image with a broken integrity record into the logical UPDATE
     partition and reboots;
  3. wolfBoot selects the v3 update, fails verification, and must erase
     the corrupt update and fall back to v2, which reports success via
     breakpoint.

Besides the success breakpoint, the script checks the emulator flash
trace: the UPDATE partition must be erased and the BOOT partition
(holding the healthy image) must never be touched, so a regression
cannot hide behind an accidentally bootable state. Verified to fail
against the pre-fix hal_flash_erase, where boot 3 erases the healthy
image and the device bricks.
2026-07-09 15:14:51 +02:00
Alex Lanzano 76b023008b Add DEBUG_UART build test for stm32wba. Fix stm32wba clock init 2026-07-02 08:44:45 +02:00
Alex Lanzano 337dabf2f2 Implement port for STM32WBA. Bump wolfHAL lib to latest 2026-07-02 08:44:45 +02:00
aidan garske b9bd6dae17 Add WOLFCRYPT_TZ_WOLFHSM TrustZone engine for STM32H5 2026-06-24 15:49:43 -07:00
David Garske dd4fc26df8
Merge pull request #803 from rizlik/tpm_mfg_auth_value
IDevID: allow using pre-computed auth values
2026-06-22 08:49:25 -07:00
Marco Oliverio 723fffebc8 tpm: build MFG identity configs in CI 2026-06-18 11:06:18 +02:00
Brett Nicholas b52dd5a1d0 make wolfHSM client ID parameterizable and settable via Makefiles 2026-06-16 22:03:28 -06:00
David Garske 7cdfb4266a NXP T2080 / CW VPX3-152: VxWorks 7 64-bit boot support
Add wolfBoot support for booting VxWorks 7 SMP 64-bit (and signed ELF
images) on the NXP T2080 (e6500) / Curtiss-Wright VPX3-152.

Key fix: bring up the e6500 cluster L2 cache in the correct order -- set
L2PE (ECC) in its own polled write BEFORE enabling L2E, with L2FI|L2LFC --
matching CW U-Boot (SDK2.0). The previous bare-L2E init left the L2 ECC
array uninitialized for the kernel's 0x1E0000 set, machine-checking VxWorks
(MCSR[IF], L2ERRDET MBECC).

Also: ePAPR spin-table SMP bring-up of all four cores, ELF in-place loader
staging-overlap fix, DPAA/LIODN + QMan/BMan init, 64-bit OS handoff
(LAW/TLB/IVOR), and NAII 68PPC2 + CW VPX3-152 board configs.
2026-06-15 06:13:28 +02:00
Daniele Lacamera 9bfecfb617 Fix fwTPM unit test CI config 2026-06-10 21:01:16 +02:00
Alex Lanzano 5cb653b141 Remove wolfHAL specific example config 2026-06-10 17:12:25 +02:00
Alex Lanzano 01c52d87e8 remove wolfhal TARGET. Add WOLFHAL option 2026-06-10 17:12:25 +02:00
Alex Lanzano 125872c571 Create STM32WB wolfHAL example. GC sections on all test apps 2026-06-10 17:12:25 +02:00
David Garske c075549ea2 Add wolfBoot support for STM32G4 2026-05-29 13:10:15 +02:00
David Garske 9786f5608b Add wolfBoot port for STM32N6 (NUCLEO-N657X0-Q)
Co-authored-by: Aidan Garske <aidan@wolfssl.com>
2026-05-28 16:49:57 +02:00
Yosuke Shimizu f4d5340641 Add hardware-based DICE on mcxn 2026-05-21 20:49:20 +02:00
David Garske b94954eab4 Add Xilinx Zynq-7000 (ZC702) wolfBoot port 2026-05-12 12:06:05 +02:00
David Garske af40ae1471 Add STM32C5 target (NUCLEO-C5A3ZG) 2026-05-06 19:02:58 +02:00
Brett Nicholas e43e012e98 review feedback 2026-05-05 16:37:54 +02:00
Brett Nicholas a2e9267529 Adds generic cryptocb support for PK, hash, and symmetric crypto 2026-05-05 16:37:54 +02:00
David Garske 8c7b8640dd
Merge pull request #762 from danielinux/fenrir-fixes-2026-04-29
Fenrir fixes
2026-04-29 11:24:44 -07:00
Daniele Lacamera 1226776ff4 Modernize riscv build test 2026-04-29 13:24:07 +02:00
Daniele Lacamera c0f6b12721 Addressed copilot's comments 2026-04-28 15:22:41 +02:00