From 1e6fb01448291aa120b72ee6ed3c3403b6895af4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 7 Jan 2020 11:00:34 +0100 Subject: [PATCH] Make SHA512_NO_SHA384 depend on SHA512_C --- include/mbedtls/check_config.h | 4 ++++ include/mbedtls/config.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 6eae6a5e5..c3a38301c 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -510,6 +510,10 @@ #error "MBEDTLS_RSA_C defined, but none of the PKCS1 versions enabled" #endif +#if defined(MBEDTLS_SHA512_NO_SHA384) && !defined(MBEDTLS_SHA512_C) +#error "MBEDTLS_SHA512_NO_SHA384 defined without MBEDTLS_SHA512_C" +#endif + #if defined(MBEDTLS_THREADING_PTHREAD) #if !defined(MBEDTLS_THREADING_C) || defined(MBEDTLS_THREADING_IMPL) #error "MBEDTLS_THREADING_PTHREAD defined, but not all prerequisites" diff --git a/include/mbedtls/config.h b/include/mbedtls/config.h index 205c7bec7..585d08776 100644 --- a/include/mbedtls/config.h +++ b/include/mbedtls/config.h @@ -1039,6 +1039,8 @@ * Disable the SHA-384 option of the SHA-512 module. Use this to save some * code size on devices that don't use SHA-384. * + * Requires: MBEDTLS_SHA512_C + * * Uncomment to disable SHA-384 */ //#define MBEDTLS_SHA512_NO_SHA384