From f6265441b04dacb7c88e1a8133a13eca9ea245bc Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Sat, 18 Jul 2020 07:09:04 -0400 Subject: [PATCH] hmac_drbg: fix default value of the prediction resistance in ctx After changing the possible prediction resistance values to have more hamming distance between them, 0 (default initialization value) no longer meant no prediction resistance. Signed-off-by: Andrzej Kurek --- library/hmac_drbg.c | 1 + 1 file changed, 1 insertion(+) diff --git a/library/hmac_drbg.c b/library/hmac_drbg.c index 92d7ba4dd..fc7aea9b5 100644 --- a/library/hmac_drbg.c +++ b/library/hmac_drbg.c @@ -62,6 +62,7 @@ void mbedtls_hmac_drbg_init( mbedtls_hmac_drbg_context *ctx ) { memset( ctx, 0, sizeof( mbedtls_hmac_drbg_context ) ); + ctx->prediction_resistance = MBEDTLS_HMAC_DRBG_PR_OFF; #if defined(MBEDTLS_THREADING_C) mbedtls_mutex_init( &ctx->mutex ); #endif