LMS/HSS and XMSS/XMSS^MT are stateful hash-based signature schemes: each
signature consumes one-time key material, and reusing it breaks the whole
key. The key tools store the private key in a plain local file and sign
rewrites it in place, a pattern that does not meet production storage
requirements (atomic, durable, protected).
- keygen: print a warning after generating an LMS/XMSS key
- sign: print a warning (once per run) after a successful LMS/XMSS
signature; other algorithms are unaffected
- docs/Signing.md: new "Stateful signatures" section explaining the
statefulness, the file-based demo/development pattern, and the
production guidance (stateless algorithm, or protected storage)
Verification:
- make -C tools/keytools: builds clean
- keygen --lms / --xmss: warning printed, rc=0; keygen --ed25519: none
- sign --lms / --xmss: warning printed once, rc=0; sign --ed25519: none
- sign --lms --delta (two signatures per run): warning printed once
- make -C tools/unit-tests run: exit 0
Add FLASH_ERASE_UNIT / WOLFBOOT_FLASH_ERASE_UNIT independently of the
logical sector size, with a sector-sized fallback and a 128-byte default
for STM32L0.
Update non-write-once hal_set_key() to cache and rewrite only the erase
units touched by the key, nonce, and trailer magic. Preserve surrounding
data, handle fields spanning units and FLAGS_HOME, and validate geometry
and partition bounds before accessing flash.
Default NVM_CACHE_SIZE to the erase unit in non-write-once builds while
keeping write-once caches and redundant trailer copies sector-sized.
On STM32L0 with 4 KiB sectors, the cache shrinks to 128 bytes.
Add erase-geometry, data-preservation, error-handling, and cache-scrubbing
tests for ChaCha20, AES-256, straddling fields, FLAGS_HOME, and the sector
fallback. Document the configuration and HAL erase contract.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Target-specific assignments in arch.mk/options.mk/board.mk used hard
'=', silently clobbering values the user set via command line,
environment, or a sourced .config (e.g. LSCRIPT_IN from PR #958 was
defeated on every target with a dedicated script).
Convert the target-default assignments to '?=' (first-set wins) and,
for LSCRIPT_IN, capture the user value before the target files are
parsed so the last-resort default (hal/$(TARGET).ld) and the ARMClang
.sct default only apply when the user provided nothing.
CMake: WOLFBOOT_LSCRIPT_TEMPLATE had the same flaw (plain set() over a
user -D value); guard it with NOT DEFINED and let test-app use an
absolute user template as-is.
Document LSCRIPT_IN as a user option in docs/compile.md.
The x86 FSP TGL boards (kontron_vx3060_s2, nai_68int6) share
hal/x86_fsp_tgl_stage1.ld; arch.mk selects it via 'LSCRIPT_IN ?=', but
the hard default here ran first, so the stage1 build of those boards
looked for a non-existent hal/kontron_vx3060_s2_stage1.ld (CI:
'kontron_vx3060_s2 build test', red on master).
- hal/renesas-rx.c builds the RX71M flash driver with CC-RX: the
driver runs from RAM through #pragma section FRAM and copyfuncs(),
and FPCKAR follows the BSP clock settings.
- IDE/Renesas/e2studio/RX71M holds the wolfBoot and app_RenesasRX01
CC-RX projects, their headers, make_images.sh and a Readme.
- docs/Renesas.md and docs/Targets.md point to the new projects, and
.gitignore lists their build and generated folders.
- test-configs.yml: RX71M build jobs, little endian and
BIG_ENDIAN=1 with WOLFBOOT_RENESAS_OSM.
- test-build-renesas-rx.yml: check that ROMCODE in wolfboot.bin is
0xFFFFFFFF for rx71m.
- Targets.md: Renesas RX71M section; Renesas.md and the CI image
README list RX71M.