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
Our ext flash has a rather peculiar 'feature' in that SPI sometimes
locks up when first accessing the ext flash. Resetting the flash chip
prior alleviates this problem.
This is highly specific and I don't expect this to make it into wolfboot
as is, but I'm hopeful we can come to some sort of solution where we
don't need to patch every new wolfboot version.
HPRE5 value 0b101 divides by 3 per RM0493, which put HCLK5 at
33.3 MHz with a 100 MHz SYSCLK, above the 32 MHz AHB5 limit. Use
0b110 (divide-by-4) for 25 MHz.
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>
Boots a signed Linux kernel, either loaded into DRAM and started from
U-Boot proper (RAM-boot, go) or started by ATF as BL33 reading a
signed FIT from eMMC (uSDHC3, FAT32).
Includes a test app and CI builds.
Copilot review follow-up: ?= considers a defined-but-empty LSCRIPT_IN
(stale LSCRIPT_IN?= line in .config, exported empty env var) already
set, so it skipped every target-specific default and fell through to
the last-resort hal/$(TARGET).ld - e.g. TARGET=stm32l5 TZEN=0 lost its
hal/stm32l5-ns.ld layout. The strip-based last-resort check only fixed
that one line, not the 32 target sites.
Add the LSCRIPT_IN_DEFAULT helper in tools/config.mk (assigns only when
LSCRIPT_IN is undefined or empty) and convert all 29 arch.mk, 2
board.mk and 1 stage1/Makefile sites to it.