From 87e0550890cd481297b533bf2e6bbc47a11c7690 Mon Sep 17 00:00:00 2001 From: Elena Uziunaite Date: Wed, 10 Jul 2024 15:45:14 +0300 Subject: [PATCH] Replace MBEDTLS_PSA_UTIL_HAVE_ECDSA with PSA_HAVE_ALG_SOME_ECDSA Signed-off-by: Elena Uziunaite --- tf-psa-crypto/core/psa_util.c | 4 ++-- tf-psa-crypto/drivers/builtin/include/mbedtls/asn1.h | 4 ++-- tf-psa-crypto/drivers/builtin/include/mbedtls/asn1write.h | 4 ++-- tf-psa-crypto/drivers/builtin/include/mbedtls/psa_util.h | 4 ++-- tf-psa-crypto/drivers/builtin/src/asn1parse.c | 4 ++-- tf-psa-crypto/drivers/builtin/src/asn1write.c | 4 ++-- .../tests/suites/test_suite_psa_crypto_util.function | 6 +++--- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/tf-psa-crypto/core/psa_util.c b/tf-psa-crypto/core/psa_util.c index e89b00f13..3870def4e 100644 --- a/tf-psa-crypto/core/psa_util.c +++ b/tf-psa-crypto/core/psa_util.c @@ -365,7 +365,7 @@ int mbedtls_psa_get_random(void *p_rng, #endif /* MBEDTLS_PSA_CRYPTO_CLIENT */ -#if defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) +#if defined(PSA_HAVE_ALG_SOME_ECDSA) /** * \brief Convert a single raw coordinate to DER ASN.1 format. The output der @@ -599,4 +599,4 @@ int mbedtls_ecdsa_der_to_raw(size_t bits, const unsigned char *der, size_t der_l return 0; } -#endif /* MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +#endif /* PSA_HAVE_ALG_SOME_ECDSA */ diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1.h index ff019f432..e2d7311a7 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1.h @@ -198,7 +198,7 @@ typedef struct mbedtls_asn1_named_data { mbedtls_asn1_named_data; #if defined(MBEDTLS_ASN1_PARSE_C) || defined(MBEDTLS_X509_CREATE_C) || \ - defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) + defined(PSA_HAVE_ALG_SOME_ECDSA) /** * \brief Get the length of an ASN.1 element. * Updates the pointer to immediately behind the length. @@ -245,7 +245,7 @@ int mbedtls_asn1_get_len(unsigned char **p, int mbedtls_asn1_get_tag(unsigned char **p, const unsigned char *end, size_t *len, int tag); -#endif /* MBEDTLS_ASN1_PARSE_C || MBEDTLS_X509_CREATE_C || MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +#endif /* MBEDTLS_ASN1_PARSE_C || MBEDTLS_X509_CREATE_C || PSA_HAVE_ALG_SOME_ECDSA */ #if defined(MBEDTLS_ASN1_PARSE_C) /** diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1write.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1write.h index 0c5a85ac2..708199622 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1write.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/asn1write.h @@ -37,7 +37,7 @@ extern "C" { #endif #if defined(MBEDTLS_ASN1_WRITE_C) || defined(MBEDTLS_X509_USE_C) || \ - defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) + defined(PSA_HAVE_ALG_SOME_ECDSA) /** * \brief Write a length field in ASN.1 format. * @@ -66,7 +66,7 @@ int mbedtls_asn1_write_len(unsigned char **p, const unsigned char *start, */ int mbedtls_asn1_write_tag(unsigned char **p, const unsigned char *start, unsigned char tag); -#endif /* MBEDTLS_ASN1_WRITE_C || MBEDTLS_X509_USE_C || MBEDTLS_PSA_UTIL_HAVE_ECDSA*/ +#endif /* MBEDTLS_ASN1_WRITE_C || MBEDTLS_X509_USE_C || PSA_HAVE_ALG_SOME_ECDSA*/ #if defined(MBEDTLS_ASN1_WRITE_C) /** diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/psa_util.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/psa_util.h index c78cc2333..08fa5b374 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/psa_util.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/psa_util.h @@ -141,7 +141,7 @@ static inline mbedtls_md_type_t mbedtls_md_type_from_psa_alg(psa_algorithm_t psa } #endif /* MBEDTLS_PSA_CRYPTO_CLIENT */ -#if defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) +#if defined(PSA_HAVE_ALG_SOME_ECDSA) /** Convert an ECDSA signature from raw format to DER ASN.1 format. * @@ -181,7 +181,7 @@ int mbedtls_ecdsa_raw_to_der(size_t bits, const unsigned char *raw, size_t raw_l int mbedtls_ecdsa_der_to_raw(size_t bits, const unsigned char *der, size_t der_len, unsigned char *raw, size_t raw_size, size_t *raw_len); -#endif /* MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +#endif /* PSA_HAVE_ALG_SOME_ECDSA */ /**@}*/ diff --git a/tf-psa-crypto/drivers/builtin/src/asn1parse.c b/tf-psa-crypto/drivers/builtin/src/asn1parse.c index e33fdf71d..ecea90434 100644 --- a/tf-psa-crypto/drivers/builtin/src/asn1parse.c +++ b/tf-psa-crypto/drivers/builtin/src/asn1parse.c @@ -8,7 +8,7 @@ #include "common.h" #if defined(MBEDTLS_ASN1_PARSE_C) || defined(MBEDTLS_X509_CREATE_C) || \ - defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) + defined(PSA_HAVE_ALG_SOME_ECDSA) #include "mbedtls/asn1.h" #include "mbedtls/platform_util.h" @@ -74,7 +74,7 @@ int mbedtls_asn1_get_tag(unsigned char **p, return mbedtls_asn1_get_len(p, end, len); } -#endif /* MBEDTLS_ASN1_PARSE_C || MBEDTLS_X509_CREATE_C || MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +#endif /* MBEDTLS_ASN1_PARSE_C || MBEDTLS_X509_CREATE_C || PSA_HAVE_ALG_SOME_ECDSA */ #if defined(MBEDTLS_ASN1_PARSE_C) int mbedtls_asn1_get_bool(unsigned char **p, diff --git a/tf-psa-crypto/drivers/builtin/src/asn1write.c b/tf-psa-crypto/drivers/builtin/src/asn1write.c index 775a9ef53..6355fad3b 100644 --- a/tf-psa-crypto/drivers/builtin/src/asn1write.c +++ b/tf-psa-crypto/drivers/builtin/src/asn1write.c @@ -8,7 +8,7 @@ #include "common.h" #if defined(MBEDTLS_ASN1_WRITE_C) || defined(MBEDTLS_X509_USE_C) || \ - defined(MBEDTLS_PSA_UTIL_HAVE_ECDSA) + defined(PSA_HAVE_ALG_SOME_ECDSA) #include "mbedtls/asn1write.h" #include "mbedtls/error.h" @@ -63,7 +63,7 @@ int mbedtls_asn1_write_tag(unsigned char **p, const unsigned char *start, unsign return 1; } -#endif /* MBEDTLS_ASN1_WRITE_C || MBEDTLS_X509_USE_C || MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +#endif /* MBEDTLS_ASN1_WRITE_C || MBEDTLS_X509_USE_C || PSA_HAVE_ALG_SOME_ECDSA */ #if defined(MBEDTLS_ASN1_WRITE_C) static int mbedtls_asn1_write_len_and_tag(unsigned char **p, diff --git a/tf-psa-crypto/tests/suites/test_suite_psa_crypto_util.function b/tf-psa-crypto/tests/suites/test_suite_psa_crypto_util.function index 2d8915e54..05b62538a 100644 --- a/tf-psa-crypto/tests/suites/test_suite_psa_crypto_util.function +++ b/tf-psa-crypto/tests/suites/test_suite_psa_crypto_util.function @@ -3,7 +3,7 @@ #include /* END_HEADER */ -/* BEGIN_CASE depends_on:MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +/* BEGIN_CASE depends_on:PSA_HAVE_ALG_SOME_ECDSA */ void ecdsa_raw_to_der(int key_bits, data_t *input, data_t *exp_result, int exp_ret) { unsigned char *tmp_buf = NULL; @@ -24,7 +24,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +/* BEGIN_CASE depends_on:PSA_HAVE_ALG_SOME_ECDSA */ void ecdsa_raw_to_der_incremental(int key_bits, data_t *input, data_t *exp_result) { unsigned char *tmp_buf = NULL; @@ -54,7 +54,7 @@ exit: } /* END_CASE */ -/* BEGIN_CASE depends_on:MBEDTLS_PSA_UTIL_HAVE_ECDSA */ +/* BEGIN_CASE depends_on:PSA_HAVE_ALG_SOME_ECDSA */ void ecdsa_der_to_raw(int key_bits, data_t *input, data_t *exp_result, int exp_ret) { unsigned char *in_buf = NULL;