From 424210a93c05450a7a8a5b0f6255d788b3f93f74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 17 Jun 2020 12:13:23 +0200 Subject: [PATCH] Allow inclusion of entropy.h when it's disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build was failing in all.sh component test_no_drbg_no_sha2 because entropy.h was referencing mbedtls_sha256_context but not including sha256.h when SHA-256 and SHA-512 were both disabled. This broke query_config.c which includes entropy.h (and actually all headers) unconditionally. Signed-off-by: Manuel Pégourié-Gonnard --- include/mbedtls/entropy.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/mbedtls/entropy.h b/include/mbedtls/entropy.h index ca06dc3c5..8bf5d713e 100644 --- a/include/mbedtls/entropy.h +++ b/include/mbedtls/entropy.h @@ -86,6 +86,8 @@ #define MBEDTLS_ENTROPY_SOURCE_STRONG 1 /**< Entropy source is strong */ #define MBEDTLS_ENTROPY_SOURCE_WEAK 0 /**< Entropy source is weak */ +#if defined(MBEDTLS_ENTROPY_C) + #ifdef __cplusplus extern "C" { #endif @@ -286,4 +288,6 @@ int mbedtls_entropy_source_self_test( int verbose ); } #endif +#endif /* MBEDTLS_ENTROPY_C */ + #endif /* entropy.h */