From 178b5bdddf26ba5ee0371684a142b4ecb9fdd772 Mon Sep 17 00:00:00 2001 From: Valerio Setti Date: Mon, 13 Feb 2023 10:04:28 +0100 Subject: [PATCH] pk: move MBEDTLS_PK_CAN_ECDSA_SOME macro to pk.h and fix tests Signed-off-by: Valerio Setti --- include/mbedtls/pk.h | 4 ++++ library/oid.c | 2 +- library/pk_wrap.h | 4 ---- tests/suites/test_suite_x509parse.function | 2 +- tests/suites/test_suite_x509write.function | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/mbedtls/pk.h b/include/mbedtls/pk.h index 29cac2793..b5c02b0d0 100644 --- a/include/mbedtls/pk.h +++ b/include/mbedtls/pk.h @@ -177,6 +177,10 @@ typedef struct mbedtls_pk_rsassa_pss_options { #endif /* PSA_WANT_ALG_ECDSA */ #endif /* MBEDTLS_USE_PSA_CRYPTO */ +#if defined(MBEDTLS_PK_CAN_ECDSA_VERIFY) || defined(MBEDTLS_PK_CAN_ECDSA_SIGN) +#define MBEDTLS_PK_CAN_ECDSA_SOME +#endif + /** * \brief Types for interfacing with the debug module */ diff --git a/library/oid.c b/library/oid.c index e532bf3e4..e7c12248a 100644 --- a/library/oid.c +++ b/library/oid.c @@ -26,7 +26,7 @@ #include "mbedtls/oid.h" #include "mbedtls/rsa.h" #include "mbedtls/error.h" -#include "pk_wrap.h" +#include "mbedtls/pk.h" #include "mbedtls/legacy_or_psa.h" diff --git a/library/pk_wrap.h b/library/pk_wrap.h index ac5c72f10..7df96089d 100644 --- a/library/pk_wrap.h +++ b/library/pk_wrap.h @@ -31,10 +31,6 @@ #include "psa/crypto.h" #endif /* MBEDTLS_PSA_CRYPTO_C */ -#if defined(MBEDTLS_PK_CAN_ECDSA_VERIFY) || defined(MBEDTLS_PK_CAN_ECDSA_SIGN) -#define MBEDTLS_PK_CAN_ECDSA_SOME -#endif - struct mbedtls_pk_info_t { /** Public key type */ mbedtls_pk_type_t type; diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index e7f3870ee..3454da352 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -8,8 +8,8 @@ #include "mbedtls/oid.h" #include "mbedtls/base64.h" #include "mbedtls/error.h" +#include "mbedtls/pk.h" #include "string.h" -#include "pk_wrap.h" #include "mbedtls/legacy_or_psa.h" diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index be48c4164..cd1f203ea 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -6,7 +6,7 @@ #include "mbedtls/oid.h" #include "mbedtls/rsa.h" #include "mbedtls/asn1write.h" -#include "pk_wrap.h" +#include "mbedtls/pk.h" #include "hash_info.h" #include "mbedtls/legacy_or_psa.h"