Commit Graph

545 Commits (8015a1fa4ff961763cdb7f01012cd243eadf097d)

Author SHA1 Message Date
David Garske 8015a1fa4f Peer review fixes (thanks Daniele) 2026-08-24 12:47:34 +02:00
David Garske 88984858d5 Peer review fixes (thanks Jack) 2026-08-24 12:47:34 +02:00
David Garske 67c819bc0b cm4: add RAUC A/B slot selection via U-Boot env (wolfBoot replaces U-Boot) 2026-08-24 12:47:34 +02:00
David Garske 56651bde95 cm4: add Linux kernel FIT boot via firmware-provided DTB with injected bootargs 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
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 502a69e9df Condense the verbose comments
The test file headers ran to 20-40 lines of prose before the licence,
restating the whole finding and the harness design. Cut them to a short
paragraph on what broke and a short one on how the test reaches the
code. Same for the long inline blocks in the HAL and libwolfboot
changes.

Comments only; no functional change.
2026-08-18 20:12:06 +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 3865c62614 user_settings: actually harden fast math for software DICE
tfm.c never tests WC_NO_HARDEN, so dropping it enabled nothing; it only
un-silenced the advisory #warning in settings.h, which -Werror turns
into a build failure for any USE_FAST_MATH + WOLFCRYPT_TZ_PSA build.
Define TFM_TIMING_RESISTANT, which is what makes tfm.c constant time.
2026-08-18 09:19:13 +02:00
Daniele Lacamera b9c32027bc F-9722: keep WC_NO_HARDEN out of software-DICE fast-math builds
The comment justified WC_NO_HARDEN on the grounds that 'wolfBoot only
does public asymmetric operations'. That is not true for software
DICE: with WOLFCRYPT_TZ_PSA and no WOLFBOOT_DICE_HW, src/dice/dice.c
retrieves the private IAK (wolfboot_attest_get_private_key) and signs
the attestation claims with wc_CoseSign1_Sign_ex(), and arch.mk still
selects USE_FAST_MATH for those builds. A configuration maintainer
trusting the comment would have left the private-key signing path
without timing hardening.

Gate the definition to verify-only configurations: WC_NO_HARDEN is
now defined only when WOLFCRYPT_TZ_PSA is absent or WOLFBOOT_DICE_HW
is set (hardware DICE keeps signing in the crypto engine), and the
comment states the actual rationale.

Verified with a preprocessor probe: plain fast-math and hardware DICE
still get WC_NO_HARDEN; software DICE no longer does.
2026-08-18 05:03:00 +02:00
Daniele Lacamera 3a3f66e1b4 F-9720: describe IMG_STATE_TESTING as the post-swap boot-confirmation state
The comment labeled IMG_STATE_TESTING as an 'ELF loading state', but
the constant is wolfBoot's general dual-bank confirm/rollback marker:
it is set on the BOOT partition after every swap (update_flash.c,
update_flash_hwswap.c, update_ram.c - none ELF-specific) and cleared
by wolfBoot_success(); if still present at the next boot it triggers
a rollback. A maintainer trusting the old comment could have treated
the state as inert on non-ELF targets and disabled the anti-brick
path.

Reword to the accurate description already used in
docs/flash_partitions.md, keeping the note that it only lives on the
boot partition so it cannot conflict with IMAGE_STATE_UPDATING.

Comment-only change; no code or behavior changes.
2026-08-18 05:01:22 +02:00
Alex Lanzano 4fb9e81b44
Merge pull request #853 from dgarske/zynqmp_sdhci_reset
SDHCI: fix silent read failures and unbootable warm reset with UHS-I cards
2026-08-14 12:51:20 -04: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 38ec1e1bed sdhci: fix silent read failures and unbootable warm reset with UHS-I cards 2026-08-11 15:37:56 -07:00
David Garske 2b3b7034a5 aarch64_efi: address PR818 review (measure cmdline, DTB GUID, size/page/desc fixes) 2026-08-10 21:03:50 +02: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
Daniele Lacamera 31f0168afc ARMORED: harden digest comparison against instruction skips 2026-08-05 20:13:44 +02:00
David Garske 5f40400e57 PolarFire SoC: address PR review
- wolfBoot_fit_memcpy: return int so a failed PDMA copy propagates instead
  of being swallowed. The weak default (memcpy) returns 0; the MPFS250 PDMA
  override returns -1 if any chunk's mpfs_pdma_memcpy() fails. Callers now
  fail closed: fit_load_image_inner returns NULL (kernel load then panics
  via update_disk.c), the update_disk DTS copy panics, and hal_dts_fixup
  returns an error on a failed L2->DDR copy-back.
- options.mk: gate -DSTACK_SIZE_PER_HART behind RISC-V arch (RISCV/RISCV64).
  The macro is only consumed by the RISC-V startup asm and the mpfs250-m.ld
  sed token, so it is no longer emitted for PPC/ARM/other targets. The
  unconditional default (?= 0) is kept because the linker sed always needs
  a value to substitute.
2026-08-03 12:27:22 +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 bb6aa35d02 Don't define WOLFSSL_HAVE_SP_ECC under SP_MATH_ALL (fixes CI) 2026-07-31 14:33:56 +02:00
Mattia Moffa 60b9e87413 SHA256 acceleration for bootloader 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 d073ae4ddb watchdog: add generic feed hook and RX driver 2026-07-30 15:32:31 +02:00
David Garske eaa39be9e4 renesas-rx: fix build for GCC RX 8.3/14.2 2026-07-30 15:32:31 +02:00
David Garske 29c9ea1ce1 test-app: add wolfIP + wolfCrypt test harness and PPC crypto asm 2026-07-30 13:29:09 +02:00
Aidan Garske 4ab9891830
Merge pull request #836 from bigbrett/wh-tz-fix-unconditional-sha512-enable
fix unconditional SHA512 opt-in for wolfHSM builds
2026-07-29 12:21:54 -07:00
Marco Oliverio 15c7e621ed wolfHSM client: target-independent build fixes and improvement
Four fixes needed by any wolfHSM client

- include/user_settings.h emitted "typedef struct WC_RNG WC_RNG;" whenever
  WOLF_CRYPTO_CB && WC_NO_RNG, with no __ASSEMBLER__ guard, so a client built
  with ARM thumb2 assembly failed to assemble wolfSSL's .S sources. Guard it.

- options.mk hardcoded WOLFHSM_CFG_COMM_DATA_LEN=5000 for every client. Make
  it a variable (default unchanged) so ports whose transport slot is smaller
  can override it.

- options.mk gated DEBUG_UART on the existence of the driver *object*, which
  never exists on a clean tree, so DEBUG_UART was dropped on the very build
  meant to enable it. Test for the source instead.

- Makefile unconditionally built an NVM key image with whnvmtool for
  WOLFHSM_CLIENT=1. Add WOLFHSM_NVM_IMAGE=0 for ports that install the
  verification key at boot instead.
2026-07-29 18:07:45 +02:00
Brett Nicholas fa53af0b49 remove unconditional SHA512 opt-in for wolfHSM server targets and scope to only TZ mode 2026-07-28 13:14:53 -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
Daniele Lacamera 4d67268a03 version: 2.9.0 2026-07-02 22:58:46 +02:00
Daniele Lacamera 195610647c armored: address review on hardened compare and fw_base check 2026-07-02 20:33:07 +02:00
Daniele Lacamera 6708438024 armored: use hardened digest compare in elf and delta paths 2026-07-02 20:11:46 +02:00
Daniele Lacamera eca9a20b3b armored: harden fw_base against fault injection 2026-07-02 20:09:16 +02:00
Mattia Moffa d15f4cbbf2 Revert check for overlap of swap/update with bootloader
Some configs may exploit that possibility
2026-07-02 17:53:12 +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
Mattia Moffa 1da9866630 Diagnostics: record additional events
- Failed boot after emergency update (WOLFBOOT_FAILURE_PHASE_RECOVERY)
- Failed verification of self-update image
2026-07-02 17:53:12 +02:00
Mattia Moffa 00e228d8d7 Check diagnostics partition is aligned and doesn't overlap
Also updates docs to specify the requirement of the HAL flash driver by
wolfBoot_clear_failures().
2026-07-02 17:53:12 +02:00
Mattia Moffa ceaed58782 Allow configuration of diagnostics record size on flash 2026-07-02 17:53:12 +02:00
Mattia Moffa 69e8e044c9 Add unit tests 2026-07-02 17:53:12 +02:00
Mattia Moffa 7cc4990907 Add option to persist boot/update failure info to flash
When boot/update partition verification fails during boot or update,
with this option the event is logged to flash in an ad-hoc partition.
Information about logged failures is made available to the application
through an API.
2026-07-02 17:53:12 +02:00
Daniele Lacamera ed695bb0a2 armored: reset integrity state and extend sanity check 2026-07-01 20:28:58 +02:00
Daniele Lacamera 93f068b930 armored: harden image integrity check against fault injections 2026-07-01 19:48:02 +02:00
aidan garske b9bd6dae17 Add WOLFCRYPT_TZ_WOLFHSM TrustZone engine for STM32H5 2026-06-24 15:49:43 -07:00
Marco Oliverio 0438c54c9b tpm: rename masterPassword param to authOverride 2026-06-18 11:06:18 +02:00
Marco Oliverio cb56e866b6 tpm: remove trailing whitespace in MFG identity docs 2026-06-18 10:45:13 +02:00
Marco Oliverio 8518eabc23 tpm: fix wolfBoot_tpm2_get_aik typo in header comment 2026-06-18 10:45:02 +02:00
Marco Oliverio 801ae8f1ca tpm: DevId identity allow to use precomputed auth values
Allow to either use a master different that the sample one or to
directly use the pre-computed per-device auth values for EH and AIK.
Using the per-device value is preferred as it doesn't expose the auth
value of the sibling devices in the same fleet.
2026-06-17 15:46:34 +02: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