wolfBoot/tools/xmss
Daniele Lacamera b896caeea0 F-14301, F-14302: keep no libc stdio copy of key material;
The keytools read and write private keys through fully buffered
stdio streams: for key files smaller than the stdio buffer, libc
copies the raw key bytes into its internal FILE buffer, and
fclose() frees that buffer without scrubbing it, so a copy of
every key survives the explicit zero_and_free()/wc_ForceZero()
wipes. Open every secret-material stream unbuffered with
setvbuf(f, NULL, _IONBF, 0) right after fopen():

- sign.c load_key(): the private key file. Also close the
  stream on the short-read failure path, which previously
  leaked it.
- sign.c make_header_ex(): the firmware encryption key/IV file.
- keygen.c: the five private-key write sites (RSA, ECC,
  Ed25519, Ed448, ML-DSA).
- lms_common.h / xmss_common.h: the LMS/XMSS private-state
  write, verify-read and read callbacks.

Public-key export streams are left buffered: not secret.
Host-side hardening only: whoever can read the tool heap can
read the key file too.
2026-09-29 09:13:25 +02:00
..
0001-Patch-to-support-wolfSSL-xmss-reference-integration.patch XMSS wolfBoot support. 2023-11-06 14:31:05 +01:00
xmss_common.h F-14301, F-14302: keep no libc stdio copy of key material; 2026-09-29 09:13:25 +02:00
xmss_siglen.sh XMSS wolfBoot support. 2023-11-06 14:31:05 +01:00