From 270b3f9790367663106ae5ddd6c2dd644c92c698 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Fri, 3 Mar 2023 05:54:13 -0500 Subject: [PATCH] Rename error_pair_t to mbedtls_error_pair_t Required by our coding standards. Signed-off-by: Andrzej Kurek --- include/mbedtls/psa_util.h | 14 +++++++------- library/psa_util.c | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/mbedtls/psa_util.h b/include/mbedtls/psa_util.h index aa6c4613c8..6d5843d017 100644 --- a/include/mbedtls/psa_util.h +++ b/include/mbedtls/psa_util.h @@ -347,28 +347,28 @@ extern mbedtls_psa_drbg_context_t *const mbedtls_psa_random_state; typedef struct { psa_status_t psa_status; int16_t mbedtls_error; -} error_pair_t; +} mbedtls_error_pair_t; #if !defined(MBEDTLS_MD_C) || !defined(MBEDTLS_MD5_C) || defined(MBEDTLS_USE_PSA_CRYPTO) -extern const error_pair_t psa_to_md_errors[4]; +extern const mbedtls_error_pair_t psa_to_md_errors[4]; #endif #if defined(MBEDTLS_LMS_C) -extern const error_pair_t psa_to_lms_errors[3]; +extern const mbedtls_error_pair_t psa_to_lms_errors[3]; #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) -extern const error_pair_t psa_to_ssl_errors[7]; +extern const mbedtls_error_pair_t psa_to_ssl_errors[7]; #endif #if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) || \ defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) -extern const error_pair_t psa_to_pk_rsa_errors[8]; +extern const mbedtls_error_pair_t psa_to_pk_rsa_errors[8]; #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) && \ defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) -extern const error_pair_t psa_to_pk_ecdsa_errors[7]; +extern const mbedtls_error_pair_t psa_to_pk_ecdsa_errors[7]; #endif /* Generic fallback function for error translation, @@ -378,7 +378,7 @@ int psa_generic_status_to_mbedtls(psa_status_t status); /* This function iterates over provided local error translations, * and if no match was found - calls the fallback error translation function. */ int psa_status_to_mbedtls(psa_status_t status, - const error_pair_t *local_translations, + const mbedtls_error_pair_t *local_translations, size_t local_errors_num, int (*fallback_f)(psa_status_t)); diff --git a/library/psa_util.c b/library/psa_util.c index f18664e6f9..fefeea56df 100644 --- a/library/psa_util.c +++ b/library/psa_util.c @@ -34,7 +34,7 @@ /* PSA_SUCCESS is kept at the top of each error table since * it's the most common status when everything functions properly. */ #if !defined(MBEDTLS_MD_C) || !defined(MBEDTLS_MD5_C) || defined(MBEDTLS_USE_PSA_CRYPTO) -const error_pair_t psa_to_md_errors[] = +const mbedtls_error_pair_t psa_to_md_errors[] = { { PSA_SUCCESS, 0 }, { PSA_ERROR_NOT_SUPPORTED, MBEDTLS_ERR_MD_FEATURE_UNAVAILABLE }, @@ -43,7 +43,7 @@ const error_pair_t psa_to_md_errors[] = }; #endif #if defined(MBEDTLS_LMS_C) -const error_pair_t psa_to_lms_errors[] = +const mbedtls_error_pair_t psa_to_lms_errors[] = { { PSA_SUCCESS, 0 }, { PSA_ERROR_BUFFER_TOO_SMALL, MBEDTLS_ERR_LMS_BUFFER_TOO_SMALL }, @@ -51,7 +51,7 @@ const error_pair_t psa_to_lms_errors[] = }; #endif #if defined(MBEDTLS_USE_PSA_CRYPTO) || defined(MBEDTLS_SSL_PROTO_TLS1_3) -const error_pair_t psa_to_ssl_errors[] = +const mbedtls_error_pair_t psa_to_ssl_errors[] = { { PSA_SUCCESS, 0 }, { PSA_ERROR_INSUFFICIENT_MEMORY, MBEDTLS_ERR_SSL_ALLOC_FAILED }, @@ -65,7 +65,7 @@ const error_pair_t psa_to_ssl_errors[] = #if defined(PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY) || \ defined(PSA_WANT_KEY_TYPE_RSA_KEY_PAIR) -const error_pair_t psa_to_pk_rsa_errors[] = +const mbedtls_error_pair_t psa_to_pk_rsa_errors[] = { { PSA_SUCCESS, 0 }, { PSA_ERROR_NOT_PERMITTED, MBEDTLS_ERR_RSA_BAD_INPUT_DATA }, @@ -80,7 +80,7 @@ const error_pair_t psa_to_pk_rsa_errors[] = #if defined(MBEDTLS_USE_PSA_CRYPTO) && \ defined(PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY) -const error_pair_t psa_to_pk_ecdsa_errors[] = +const mbedtls_error_pair_t psa_to_pk_ecdsa_errors[] = { { PSA_SUCCESS, 0 }, { PSA_ERROR_NOT_PERMITTED, MBEDTLS_ERR_ECP_BAD_INPUT_DATA }, @@ -111,7 +111,7 @@ int psa_generic_status_to_mbedtls(psa_status_t status) } int psa_status_to_mbedtls(psa_status_t status, - const error_pair_t *local_translations, + const mbedtls_error_pair_t *local_translations, size_t local_errors_size, int (*fallback_f)(psa_status_t)) {