Commit Graph

494 Commits (ca6b60a1e6fbf56996e1f40f6b83d8360503604c)

Author SHA1 Message Date
Daniele Lacamera 431b01560d F-9759: document that QE/FMan microcode is not authenticated
The P1021 QE and T10xx QE/FMan microcode blobs are validated only for
structural integrity (header magic, version, size bounds) before they
are activated; no cryptographic authentication is applied. State that
in Targets.md for both targets, with the deployment-model reasoning:
the P1021 microcode region sits inside the update partition, and the
T10xx regions require local board flash write access, which also
allows replacing the wolfBoot image itself.

Same residual claim as F-8000 and F-9761 (T10xx QE and FMan paths);
the bounds fixes for all three are already in master (000c05c7,
91c020a2). Product decision: no microcode authentication feature.
2026-08-21 08:52:59 +02:00
Sameeh Jubran da1d2cfc27 sbom: generate the keystore before checking the source list
src/keystore.c holds the public keys that authorise a firmware update.  The
build generates it from the signing key, so a fresh checkout does not hold it,
and the missing-source guard read that absence as an absent submodule.  Every
Make-path SBOM job failed on it.

Depend on it, so it exists before the guard runs, and name it in the source
list unconditionally: sbom.mk expands SBOM_SRCS through $(call) while reading
the makefile, so a file that appears later can never reach the document.
Without that second half the guard passed while the document was still one
source short, which is the silent under-report the guard exists to prevent.

Build the list with $(shell) rather than $(wildcard).  GNU make 3.81 caches
directory contents, so it never sees a source generated during the same run.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 864a5252d2 docs: state what the wolfBoot SBOM does not cover
Four exclusions were implicit, and a reader had no way to see them from
the document itself:

  * the compiler runtime (libgcc, newlib) is linked into every image and
    appears nowhere;
  * of the six submodules only wolfSSL becomes a component, so a wolfTPM,
    wolfHSM or wolfPKCS11 advisory cannot match, even though the captured
    configuration records that the stack is compiled in;
  * the document records the source set rather than each file, so SPDX
    reports filesAnalyzed: false and the Merkle hash cannot be taken apart;
  * WOLFCRYPT_ONLY is set for nearly every configuration, so a scanner
    reports wolfSSL TLS advisories against an image with no TLS, and
    wolfBoot ships no VEX statement to answer them with.

The first is inherent to a source-set SBOM. The other three are open
work, and the wolfGlass component table and a VEX target are where they
get closed.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 433c6ae85c sbom: name each document after the configuration it describes
Both output files were wolfboot-<version>.{cdx,spdx}.json, so every
configuration at a given version wrote to the same two paths. wolfBoot has
on the order of 100 target configurations and each is a different image
with a different source set, so building a second one overwrote the first
with no warning.

Put TARGET, SIGN and HASH in the name, on the Make and the CMake route
alike, so the two routes stay in step.

This does not fix the identity of the documents themselves. gen-sbom
derives both the CycloneDX serialNumber and the SPDX documentNamespace
from name and version only, so sim and stm32h7 at 2.9.0 still share
urn:uuid:6dc51759-ade2-5967-b392-2f23ed0eb4df, which a tool that keys on
serialNumber treats as one project. That is a wolfGlass change, and it
is not worked around here.

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 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 5093992973 sbom: emit the registered wolfBoot CPE after NVD publication
Re-vendor wolfGlass tip where PRODUCT_CPE marks wolfboot registered
(NVD dictionary entries created 2026-08-10). Docs drop the "no CPE yet"
wording. The main package now carries cpe:2.3🅰️wolfssl:wolfboot:<ver>.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran a4ef6c4618 sbom: describe the wolfSSL the image really holds
The bootloader is built WOLFCRYPT_ONLY: include/user_settings.h defines
it for every configuration except a wolfHSM server with certificate-chain
verification, so the image carries the crypto subset of wolfSSL and no
TLS.  The SBOM said nothing about that, leaving an integrator to triage
TLS advisories against a bootloader that cannot run TLS.  The re-vendored
generator reads the macro out of the captured configuration and records
the subset; the wolfssl component stays, because it is the identifier NVD
maps wolfSSL advisories to and the wolfcrypt one has no CVEs mapped to it
at all.  wolfcrypt is now nested inside wolfssl rather than beside it,
which is where it ships from.

wolfBoot also stopped emitting a CPE.  NVD has no wolfssl:wolfboot entry,
and an unlisted CPE is indistinguishable to a scanner from a listed one
with no advisories; the submitted identifier is recorded as
wolfssl:sbom:cpe-requested until the dictionary request is published.

The CMake route passed its -D set with no settings header, so it recorded
none of the configuration user_settings.h derives from that set -- a
different document than `make sbom` produced from the same tree, and one
that could not see WOLFCRYPT_ONLY.  It now passes the same SETTINGS_H and
INCLUDE_DIRS the Makefile does.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran 240bf081b6 sbom: identify the embedded wolfSSL so a CPE-driven scan can see it
Re-vendor the wolfGlass tip that gives every dependency component a CPE
alongside its PURL, and that emits pkg:github identifiers a consumer can
actually resolve.  The wolfSSL entry in a wolfBoot SBOM previously carried
a PURL only, and that PURL pointed at a git tag which does not exist
(wolfSSL releases are tagged `-stable`), so an integrator monitoring NVD
could not match wolfSSL advisories against this firmware.

The CMake route also described a different product than the Make route:
it never declared the wolfSSL dependency, so its `components` array was
empty, and it recorded wolfBoot as a GPL-3.0-only library rather than a
GPL-3.0-or-later firmware image.  Both routes now emit the same component
identity for the same configuration.

wolfCrypt stays inventoried as wolfBoot's own sources.  It is not a
separate NVD product; its advisories are published against
wolfssl:wolfssl, so the wolfSSL identifiers cover that code.

Signed-off-by: Sameeh Jubran <sameeh@wolfssl.com>
2026-08-20 15:22:16 +02:00
Sameeh Jubran f87bc0f465 sbom: record the real build configuration
Re-vendor wolfGlass a54cde1 and declare what the capture needs.
wolfBoot's wolfCrypt configuration is derived rather than literal:
include/user_settings.h turns WOLFBOOT_SIGN_ECC256 into HAVE_ECC,
HAVE_ECC256, ECC_TIMING_RESISTANT and the rest. Capturing CFLAGS alone
recorded the -D set and none of what it selects, so the SBOM described a
signing bootloader with no signature algorithm. Point SBOM_SETTINGS_H at
the wolfCrypt settings header, give it SBOM_INCLUDE_DIRS, and make
include/target.h a prerequisite since user_settings.h includes it and it
carries the flash layout.

For an stm32u5 ECC256 build the configuration record now holds 151
defines, including WOLFBOOT_SIGN_ECC256, HAVE_ECC, HAVE_ECC256,
WOLFBOOT_HASH_SHA256 and IMAGE_HEADER_SIZE=256, none of which appeared
before. BOOTLOADER_PARTITION_SIZE is 65536 rather than the literal `)`
that Make's double expansion had left in its place.

Declare wolfSSL as a dependency component by default, pinned to the
submodule's version. wolfCrypt is compiled into the image rather than
linked, so its sources are listed as wolfBoot's own; recording the
dependency as well is what lets a scanner match wolfSSL advisories
against this firmware.

Record the product as firmware rather than a library, in CycloneDX
component.type and SPDX primaryPackagePurpose alike. Override the
licence to GPL-3.0-or-later: LICENSE is the verbatim GPLv3 and says
nothing about how wolfBoot licenses under it, while all 252
GPL-headered sources say "either version 3 ... or (at your option) any
later version". The per-HAL SBOM inherits the override so the two
documents cannot contradict each other.

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 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
Brett Nicholas 25aa151f0b add asymmetric partition sizing for monolithic updates 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
Daniele Lacamera edd13a4b68 raspi3: fix the DEBUG_UART build and the documented key size
DEBUG_UART=1 did not compile: uart_init() declared an unused local and
-Werror rejected it, so the target's console output could never be
enabled. Drop the local.

The documented key file is 44 bytes, but AES256-CTR wants a 32-byte key
plus a 16-byte IV; sign fails with "Error reading IV" as written. Use
48 bytes, matching the key the HAL used to carry.
2026-08-18 19:58:56 +02:00
Daniele Lacamera 57db8948d1 Remove tracker ids from code, condense comments
Drop the internal report numbers from source, test and Makefile
comments: they mean nothing outside the tracker and do not belong in
the tree. Condense the long inline comment blocks the review flagged,
and note in the raspi3 encrypted example and its docs that CI builds
but does not boot it, so the end-to-end path has no automated
coverage.

Comments and docs only; no functional change.
2026-08-18 19:48:12 +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 cd2795f105 raspi3: document that the encrypted example needs a provisioned key
Removing the hardcoded test key is right, but nothing on this target
calls wolfBoot_set_encrypt_key() any more, so the shipped example and
the docs walk-through (whose example key was that same test key) no
longer boot an encrypted image. Say so in both places.
2026-08-18 10:00:30 +02:00
David Garske c8faa5adc2 Authenticate raw device tree via signed HDR_DEVICE_TREE_DIGEST TLV (Fenrir #7998) 2026-08-13 08:39:22 +02:00
David Garske f505f88bd3
Merge pull request #847 from bigbrett/wolfhsm-expose-max-verify-roots
wolfHSM: expose max verify roots in options.mk
2026-08-10 12:57:19 -07:00
David Garske 4a16dce4f8 efi: authenticate the kernel command line via a signed HDR_CMDLINE manifest TLV 2026-08-10 21:03:50 +02:00
David Garske 9d50c1a6de aarch64_efi: fix open_kernel_image error return; expand kernel cmdline security docs 2026-08-10 21:03:50 +02:00
David Garske 811c9d049a aarch64_efi: measure kernel into firmware TPM via EFI_TCG2 2026-08-10 21:03:50 +02:00
David Garske 34941079e1 Add aarch64_efi target: wolfBoot as an AArch64 UEFI application 2026-08-10 21:03:50 +02:00
Brett Nicholas f9419ad495 add documentation for exposed wolfHSM config values, plus some small doc fixes 2026-08-07 11:20:03 -06: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 6da07ffc3d Add support for ARM Compiler for Embedded on stm32u5 2026-07-31 16:00:14 +02:00
Mattia Moffa 4efc00a806 Remove NAND info from Targets.md 2026-07-31 14:33:56 +02:00
Mattia Moffa d750f46723 Fix issues found by Copilot 2026-07-31 14:33:56 +02:00
Mattia Moffa 6862d57dea Support older Maxim SDK ("LPSDK") 2026-07-31 14:33:56 +02:00
Mattia Moffa f5f54c294e Implementation of test-app crypto test 2026-07-31 14:33:56 +02:00
David Garske 9d9305eebb Support for MAX32666 2026-07-31 14:33:56 +02:00
Mattia Moffa e6c87d86a9 Add --custom-tlv-pubkey-der option to signing tool
Allows extracting a public key from a DER file and adding it in the same
format as the keystore:

- `X||Y` for ECC
- Raw for Ed25519/Ed448
- Public key DER for RSA
2026-07-30 15:38:11 +02:00
David Garske d073ae4ddb watchdog: add generic feed hook and RX driver 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 5f9e7c9dac docs: reorganize and condense NXP T2080 target documentation 2026-07-30 13:29:09 +02:00
David Garske ac5f532cf9 Add NXP T2080 (+ NAII 68PPC2) wolfIP support 2026-07-30 13:29:09 +02:00
Marco Oliverio 36b665bfcc pic32cz: add wolfHSM client target
Run wolfBoot on the PIC32CZ CA9x host core (Cortex-M7) as a wolfHSM client,
offloading the image digest (SHA-256) and the ECDSA P-256 signature check to
the wolfHSM server.
2026-07-29 18:07:45 +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
Brett Nicholas 95e90f2e91 revined comment 2026-07-22 09:42:45 -06: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 22b2fe5dc9 add custom file-backed TLV sign option 2026-07-21 16:19:04 -06:00
Brett Nicholas 6c148b2e9e increase custom TLV size limit to UINT16_MAX 2026-07-21 15:15:10 -06:00
David Garske a3e2bc89d2 Add wolfBoot HAL port for RealTek RTL8735B (AmebaPro2) 2026-07-16 10:16:25 +02:00
Daniele Lacamera 16acbe3543 docs: version-agnostic boot output example 2026-07-02 22:58:46 +02:00
Mattia Moffa ef03cf007f Fix additional findings
- Check diag_erase() return value in wolfBoot_record_failure()
- Dedicated WOLFBOOT_FAILURE_PHASE_SELF_UPDATE
- Mark the diagnostics flash write buffers XALIGNED_STACK(4) for HALs
  that access the source word by word
- Ensure diagnostics, update, or swap partitions don't overlap the
  bootloader
2026-07-02 17:53:12 +02:00