mirror of https://github.com/wolfSSL/wolfBoot.git
otp-keystore-gen.c reads the device root UDS into the stack buffer `uds` and copies it into the heap buffer `otp_buf` at OTP_UDS_OFFSET, then on every exit path calls free(otp_buf) without wiping it first, and never clears `uds`. Both copies of the highest-value device secret remain in the host process's freed heap chunk and stack frame. Add a local secure_zero() helper (no wolfSSL dependency, matching this standalone host tool's existing bare-gcc build) and call it on the success path and on the write-failure/short-UDS-read error paths, before free()/exit(), mirroring the zeroize-before-release pattern already used elsewhere in this tree (src/x86/ata.c, src/x86/ahci.c). Paths that exit before `uds` is populated are left untouched since there is no secret to wipe yet. |
||
|---|---|---|
| .. | ||
| Makefile | ||
| README.md | ||
| otp-keystore-gen.c | ||
| otp-keystore-primer.c | ||
| startup.c | ||
| target.ld | ||
README.md
OTP keystore primer application
This application is used to provision the public keys into a dedicated FLASH OTP area. For more information about its usage, please refer to /docs/flash-OTP.md.
Attestation UDS storage
For targets that support it (for example STM32H5), wolfBoot can store a random UDS for DICE attestation in OTP using the primer app. This is the default approach when OBKeys secure storage is not available or not provisioned.
If you have access to STM32H5 OBKeys secure storage, prefer that for production
iRoT key material. Enable WOLFBOOT_UDS_OBKEYS=1 and provision OBKeys via
STM32TrustedPackageCreator/STM32CubeProgrammer (see docs/DICE.md). OTP should
be used for development or as a fallback when OBKeys is unavailable.