From fdf15ddfbebcc710f45123c4610c0c16b5d5a509 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Fri, 16 Jun 2023 12:50:34 +0200 Subject: [PATCH] build_info: auto enable PK_PARSE_EC_COMPRESSED when PK_PARSE_C && ECP_C This helps backward compatibility since compressed points were always supported in previous releases as long as PK_PARSE_C and ECP_C were defined. Signed-off-by: Valerio Setti --- include/mbedtls/build_info.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/include/mbedtls/build_info.h b/include/mbedtls/build_info.h index b358114788..909e10c544 100644 --- a/include/mbedtls/build_info.h +++ b/include/mbedtls/build_info.h @@ -149,6 +149,15 @@ #define MBEDTLS_ECP_LIGHT #endif +/* MBEDTLS_PK_PARSE_EC_COMPRESSED is introduced in MbedTLS version 3.5, while + * in previous version compressed points were automatically supported as long + * as PK_PARSE_C and ECP_C were enabled. As a consequence, for backward + * compatibility, we auto-enable PK_PARSE_EC_COMPRESSED when these conditions + * are met. */ +#if defined(MBEDTLS_PK_PARSE_C) && defined(MBEDTLS_ECP_C) +#define MBEDTLS_PK_PARSE_EC_COMPRESSED +#endif + /* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT * is defined as well to include all PSA code. */