From 410d8de24efee2b4cd692fd3fcb0950cf46d1288 Mon Sep 17 00:00:00 2001 From: Daniele Lacamera Date: Tue, 29 Sep 2026 08:50:44 +0200 Subject: [PATCH] F-14283: keep TFM hardening in DICE_HW secure-mode builds The WOLFBOOT_DICE_HW exception assumed hardware DICE leaves the secure world verify-only, but only the DICE attestation key runs on the crypto engine: the secure PSA service still does software RSA/ECC on keys created or imported through the IPC, so drop the exception and let every WOLFCRYPT_SECURE_MODE fastmath build define TFM_TIMING_RESISTANT. --- include/user_settings.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/user_settings.h b/include/user_settings.h index 41201d97..5ad3c664 100644 --- a/include/user_settings.h +++ b/include/user_settings.h @@ -169,9 +169,11 @@ extern int tolower(int c); /* WC_NO_HARDEN suits verify-only builds, which do public-key * operations only. Secure-mode worlds (TZ_PSA/PKCS11/FWTPM/WOLFHSM) * process private keys in software, so they keep the timing- - * resistant TFM path; hardware DICE keeps signing in the crypto - * engine and stays verify-only. */ -# if defined(WOLFCRYPT_SECURE_MODE) && !defined(WOLFBOOT_DICE_HW) + * resistant TFM path. Hardware DICE (WOLFBOOT_DICE_HW) only moves the + * DICE attestation key to the crypto engine; the secure PSA service + * still runs software RSA/ECC on keys created or imported through the + * IPC, so it needs the hardening too. */ +# if defined(WOLFCRYPT_SECURE_MODE) # define TFM_TIMING_RESISTANT # else /* tfm.c never tests WC_NO_HARDEN, so dropping it alone changes