From 8600de818cf8419b369b9f7d5ab89d872d3baa3e Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 4 Aug 2023 09:42:40 +0200 Subject: [PATCH] check_config: perform checks only when config_psa.h is evaluated Signed-off-by: Valerio Setti --- include/mbedtls/check_config.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 16253b438..b1c57cb99 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -66,6 +66,10 @@ #error "MBEDTLS_HAVE_TIME_DATE without MBEDTLS_HAVE_TIME does not make sense" #endif +/* Check that each MBEDTLS_ECP_DP symbol has its PSA_WANT_ECC counterpart, but + * only when config_psa.h is evaluated. */ +#if defined(MBEDTLS_PSA_CRYPTO_CONFIG) || defined(MBEDTLS_PSA_CRYPTO_C) + #if defined(MBEDTLS_ECP_DP_BP256R1_ENABLED) && !defined(PSA_WANT_ECC_BRAINPOOL_P_R1_256) #error "MBEDTLS_ECP_DP_BP256R1_ENABLED defined, but not its PSA counterpart" #endif @@ -119,6 +123,8 @@ #error "MBEDTLS_ECP_DP_SECP256K1_ENABLED defined, but not its PSA counterpart" #endif +#endif /* MBEDTLS_PSA_CRYPTO_CONFIG || MBEDTLS_PSA_CRYPTO_C */ + #if defined(MBEDTLS_CTR_DRBG_C) && !defined(MBEDTLS_AES_C) #error "MBEDTLS_CTR_DRBG_C defined, but not all prerequisites" #endif