From 30c4618970f0f3c5569f1dc9b637e68d80bfc4ea Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Thu, 23 Feb 2023 17:34:37 +0100 Subject: [PATCH] Add new PSA_HAS_FULL_ECDSA macro for easily signal that PSA has full ECDSA support Signed-off-by: Valerio Setti --- include/mbedtls/check_config.h | 6 ++++-- include/mbedtls/config_psa.h | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/mbedtls/check_config.h b/include/mbedtls/check_config.h index 3065df5d94..306db035e6 100644 --- a/include/mbedtls/check_config.h +++ b/include/mbedtls/check_config.h @@ -280,7 +280,8 @@ #endif #if defined(MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ + ( !defined(MBEDTLS_ECDH_C) || \ + !(defined(MBEDTLS_ECDSA_C) || defined(PSA_HAS_FULL_ECDSA)) || \ !defined(MBEDTLS_X509_CRT_PARSE_C) ) #error "MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED defined, but not all prerequisites" #endif @@ -313,7 +314,8 @@ #endif #if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) && \ - ( !defined(MBEDTLS_ECDH_C) || !defined(MBEDTLS_ECDSA_C) || \ + ( !defined(MBEDTLS_ECDH_C) || \ + !(defined(MBEDTLS_ECDSA_C) || defined(PSA_HAS_FULL_ECDSA)) || \ !defined(MBEDTLS_X509_CRT_PARSE_C) ) #error "MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED defined, but not all prerequisites" #endif diff --git a/include/mbedtls/config_psa.h b/include/mbedtls/config_psa.h index 48b2d3209e..8dff072360 100644 --- a/include/mbedtls/config_psa.h +++ b/include/mbedtls/config_psa.h @@ -308,6 +308,11 @@ extern "C" { #define PSA_HAVE_SOFT_BLOCK_AEAD 1 #endif +#if defined(PSA_WANT_ALG_ECDSA) && defined(PSA_WANT_KEY_TYPE_ECC_KEY_PAIR) && \ + defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) +#define PSA_HAS_FULL_ECDSA 1 +#endif + #if defined(PSA_WANT_KEY_TYPE_AES) #if !defined(MBEDTLS_PSA_ACCEL_KEY_TYPE_AES) #define PSA_HAVE_SOFT_KEY_TYPE_AES 1