From 7b420a896f8e90151a465420f5ed0621ce6de84c Mon Sep 17 00:00:00 2001 From: Tom Cosgrove Date: Mon, 15 Nov 2021 09:59:53 +0000 Subject: [PATCH 1/2] Fix builds when config.h only defines MBEDTLS_BIGNUM_C Fixes #4929 Signed-off-by: Tom Cosgrove --- include/mbedtls/entropy.h | 2 +- library/bignum.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/mbedtls/entropy.h b/include/mbedtls/entropy.h index ac977cf817..eea786e352 100644 --- a/include/mbedtls/entropy.h +++ b/include/mbedtls/entropy.h @@ -157,7 +157,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 3df905203f..c553d0c5af 100644 --- a/library/bignum.c +++ b/library/bignum.c @@ -72,6 +72,7 @@ #include "mbedtls/bn_mul.h" #include "mbedtls/platform_util.h" +#include #include #if defined(MBEDTLS_PLATFORM_C) From 942f8b6854af04fae9994dc72367f4e029ee293b Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 6 Dec 2021 20:56:55 +0100 Subject: [PATCH 2/2] Add changelog entry for build error fixes Signed-off-by: Gilles Peskine --- ChangeLog.d/build-without-sha.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 ChangeLog.d/build-without-sha.txt diff --git a/ChangeLog.d/build-without-sha.txt b/ChangeLog.d/build-without-sha.txt new file mode 100644 index 0000000000..78ba27694a --- /dev/null +++ b/ChangeLog.d/build-without-sha.txt @@ -0,0 +1,3 @@ +Bugfix + * Fix the build when no SHA2 module is included. Fixes #4930. + * Fix the build when only the bignum module is included. Fixes #4929.