From b807cc6ebaea1d353bd877a4f7e110619477eab7 Mon Sep 17 00:00:00 2001 From: Yanray Wang Date: Thu, 30 Nov 2023 17:16:20 +0800 Subject: [PATCH] Add checks for PK_[PARSE/WRITE]_C when PK_HAVE_ECC_KEYS is set When PK_HAVE_ECC_KEYS is set with PK_[PARSE/WRITE]_C, it needs OID_C to be enabled. This commit adds proper checks in check_config.h Signed-off-by: Yanray Wang --- include/mbedtls/check_config.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index a7a346fe5..af78087b1 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -444,6 +444,16 @@ #error "MBEDTLS_PK_WRITE_C defined, but not all prerequisites" #endif +#if defined(MBEDTLS_PK_PARSE_C) && defined(MBEDTLS_PK_HAVE_ECC_KEYS) && \ + !defined(MBEDTLS_OID_C) +#error "MBEDTLS_PK_PARSE_C and MBEDTLS_PK_HAVE_ECC_KEYS require MBEDTLS_OID_C" +#endif + +#if defined(MBEDTLS_PK_WRITE_C) && defined(MBEDTLS_PK_HAVE_ECC_KEYS) && \ + !defined(MBEDTLS_OID_C) +#error "MBEDTLS_PK_WRITE_C and MBEDTLS_PK_HAVE_ECC_KEYS require MBEDTLS_OID_C" +#endif + #if defined(MBEDTLS_PLATFORM_EXIT_ALT) && !defined(MBEDTLS_PLATFORM_C) #error "MBEDTLS_PLATFORM_EXIT_ALT defined, but not all prerequisites" #endif