From 909055d7609f8ffa89a4435f2048e8d130332e17 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Sun, 15 Mar 2026 19:32:39 +0100 Subject: [PATCH] Fix negation that broke psa_random_set_prediction_resistance Platform entropy is available when `MBEDTLS_NO_PLATFORM_ENTROPY` is _not_ defined. This caused the ok/not-supported behavior of `broke psa_random_set_prediction_resistance() to be inverted, and the unit tests checking that behavior to be similarly inverted, so the unit tests didn't catch it. Signed-off-by: Gilles Peskine --- include/mbedtls/config_adjust_legacy_crypto.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/mbedtls/config_adjust_legacy_crypto.h b/include/mbedtls/config_adjust_legacy_crypto.h index 66bad0c812..8f70a27188 100644 --- a/include/mbedtls/config_adjust_legacy_crypto.h +++ b/include/mbedtls/config_adjust_legacy_crypto.h @@ -59,14 +59,14 @@ #define MBEDTLS_ENTROPY_HARDWARE_ALT_DEFINED 0 #endif #if defined(MBEDTLS_NO_PLATFORM_ENTROPY) -#define MBEDTLS_PLATFORM_ENTROPY_DEFINED 1 +#define MBEDTLS_PLATFORM_ENTROPY_ENABLED 0 #else -#define MBEDTLS_PLATFORM_ENTROPY_DEFINED 0 +#define MBEDTLS_PLATFORM_ENTROPY_ENABLED 1 #endif #define MBEDTLS_ENTROPY_TRUE_SOURCES ( \ MBEDTLS_ENTROPY_HARDWARE_ALT_DEFINED + \ - MBEDTLS_PLATFORM_ENTROPY_DEFINED + \ + MBEDTLS_PLATFORM_ENTROPY_ENABLED + \ 0) /* Whether there is at least one entropy source for the entropy module.