From 00e424967078fad8d729f6bd585139e1d9a5e191 Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Mon, 15 Nov 2021 09:05:30 +0000 Subject: [PATCH] Fix builds when config.h only defines MBEDTLS_BIGNUM_C Fixes #4929 --- include/mbedtls/entropy.h | 2 +- library/bignum.c | 1 + programs/fuzz/common.c | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/entropy.h b/include/mbedtls/entropy.h index d6ad8e73e39a..deb3c50300b2 100644 --- a/include/mbedtls/entropy.h +++ b/include/mbedtls/entropy.h @@ -130,7 +130,7 @@ typedef struct mbedtls_entropy_context * -1 after free. */ #if defined(MBEDTLS_ENTROPY_SHA512_ACCUMULATOR) mbedtls_sha512_context accumulator; -#else +#elif defined(MBEDTLS_ENTROPY_SHA256_ACCUMULATOR) mbedtls_sha256_context accumulator; #endif int source_count; /* Number of entries used in source. */ diff --git a/library/bignum.c b/library/bignum.c index 364332664898..b7718e2178aa 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -42,6 +42,7 @@ #include "mbedtls/platform_util.h" #include "mbedtls/error.h" +#include #include #if defined(MBEDTLS_PLATFORM_C) diff --git a/programs/fuzz/common.c b/programs/fuzz/common.c index ac39ee22f3b4..e12ee3b8a0a4 100644 --- a/programs/fuzz/common.c +++ b/programs/fuzz/common.c @@ -1,4 +1,5 @@ #include "common.h" +#include #include #include #include