Refactor tf-psa-crypto to use error_common.h instead of error.h

This commit refactors tf-psa-crypto to include error_common.h instead of
error.h as these files have been split and the relevant error codes are
now inside error_common.h.

Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
This commit is contained in:
Harry Ramsey 2024-10-14 07:19:01 +01:00
parent 798d8b6533
commit a05bfeed1e
65 changed files with 69 additions and 69 deletions

View File

@ -58,13 +58,13 @@
#include "mbedtls/ecdh.h"
#include "mbedtls/ecp.h"
#include "mbedtls/entropy.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/gcm.h"
#include "mbedtls/md5.h"
#include "mbedtls/pk.h"
#include "pk_wrap.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/ripemd160.h"
#include "mbedtls/rsa.h"
#include "mbedtls/sha1.h"

View File

@ -7,8 +7,8 @@
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_ERROR_COMMON_H
#define MBEDTLS_ERROR_COMMON_H
#ifndef MBEDTLS_ERRORCOMMON_COMMON_H
#define MBEDTLS_ERRORCOMMON_COMMON_H
#include "mbedtls/build_info.h"

View File

@ -20,7 +20,7 @@
#include "mbedtls/aes.h"
#include "mbedtls/platform.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_AES_USE_HARDWARE_ONLY)
#if !((defined(MBEDTLS_ARCH_IS_ARMV8_A) && defined(MBEDTLS_AESCE_C)) || \

View File

@ -12,7 +12,7 @@
#include "mbedtls/asn1.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -11,7 +11,7 @@
defined(PSA_HAVE_ALG_SOME_ECDSA)
#include "mbedtls/asn1write.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -30,7 +30,7 @@
#include "bignum_internal.h"
#include "bn_mul.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "constant_time_internal.h"
#include <limits.h>

View File

@ -11,7 +11,7 @@
#include <string.h>
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform_util.h"
#include "constant_time_internal.h"

View File

@ -12,7 +12,7 @@
#include <string.h>
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/bignum.h"
#include "mbedtls/platform.h"

View File

@ -11,7 +11,7 @@
#include <string.h>
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/platform.h"

View File

@ -20,7 +20,7 @@
#include "mbedtls/ccm.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/constant_time.h"
#if defined(MBEDTLS_BLOCK_CIPHER_C)

View File

@ -15,7 +15,7 @@
#include "mbedtls/chacha20.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <stddef.h>
#include <string.h>

View File

@ -12,7 +12,7 @@
#include "mbedtls/chachapoly.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/constant_time.h"
#include <string.h>

View File

@ -16,7 +16,7 @@
#include "mbedtls/cipher.h"
#include "cipher_wrap.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/constant_time.h"
#include "constant_time_internal.h"

View File

@ -14,7 +14,7 @@
#if defined(MBEDTLS_CIPHER_C)
#include "cipher_wrap.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_CHACHAPOLY_C)
#include "mbedtls/chachapoly.h"

View File

@ -32,7 +32,7 @@
#include "mbedtls/cmac.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform.h"
#include "constant_time_internal.h"

View File

@ -16,7 +16,7 @@
#include "common.h"
#include "constant_time_internal.h"
#include "mbedtls/constant_time.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform_util.h"
#include <string.h>

View File

@ -17,7 +17,7 @@
#include "ctr.h"
#include "mbedtls/ctr_drbg.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -16,7 +16,7 @@
#if defined(MBEDTLS_DES_C)
#include "mbedtls/des.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform_util.h"
#include <string.h>

View File

@ -19,7 +19,7 @@
#include "mbedtls/dhm.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -18,7 +18,7 @@
#include "mbedtls/ecdh.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -27,7 +27,7 @@
#include "mbedtls/platform.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_ECP_RESTARTABLE)

View File

@ -16,7 +16,7 @@
#include "mbedtls/ecjpake.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -36,7 +36,7 @@
#include "mbedtls/ecp.h"
#include "mbedtls/threading.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "bn_mul.h"
#include "ecp_invasive.h"

View File

@ -13,7 +13,7 @@
#include "mbedtls/ecp.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "bn_mul.h"
#include "bignum_core.h"

View File

@ -14,7 +14,7 @@
#include "mbedtls/ecp.h"
#include "mbedtls/platform.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform.h"

View File

@ -12,7 +12,7 @@
#include "mbedtls/entropy.h"
#include "entropy_poll.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -20,7 +20,7 @@
#include "mbedtls/entropy.h"
#include "entropy_poll.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_TIMING_C)
#include "mbedtls/timing.h"

View File

@ -22,7 +22,7 @@
#include "mbedtls/gcm.h"
#include "mbedtls/platform.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/constant_time.h"
#if defined(MBEDTLS_BLOCK_CIPHER_C)

View File

@ -11,7 +11,7 @@
#include <string.h>
#include "mbedtls/hkdf.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
int mbedtls_hkdf(const mbedtls_md_info_t *md, const unsigned char *salt,
size_t salt_len, const unsigned char *ikm, size_t ikm_len,

View File

@ -17,7 +17,7 @@
#include "mbedtls/hmac_drbg.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -28,7 +28,7 @@
#include "mbedtls/lms.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "psa_util_internal.h"
#include "psa/crypto.h"

View File

@ -29,7 +29,7 @@
#include "psa/crypto.h"
#include "psa_util_internal.h"
#include "mbedtls/lms.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/platform.h"

View File

@ -32,7 +32,7 @@
#include "mbedtls/md.h"
#include "md_wrap.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/md5.h"
#include "mbedtls/ripemd160.h"

View File

@ -16,7 +16,7 @@
#include "mbedtls/md5.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -21,7 +21,7 @@
#include "mbedtls/nist_kw.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/constant_time.h"
#include "constant_time_internal.h"

View File

@ -13,7 +13,7 @@
#include "mbedtls/oid.h"
#include "mbedtls/rsa.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/pk.h"
#include <stdio.h>

View File

@ -16,7 +16,7 @@
#include "mbedtls/md.h"
#include "mbedtls/cipher.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -14,7 +14,7 @@
#include "pk_internal.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_RSA_C)
#include "mbedtls/rsa.h"

View File

@ -8,7 +8,7 @@
#include "common.h"
#include "mbedtls/pk.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/ecp.h"
#include "pk_internal.h"

View File

@ -12,7 +12,7 @@
#if defined(MBEDTLS_PK_C)
#include "pk_wrap.h"
#include "pk_internal.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/psa_util.h"
/* Even if RSA not activated, for the sake of RSA-alt */

View File

@ -21,7 +21,7 @@
#include "mbedtls/cipher.h"
#endif /* MBEDTLS_CIPHER_C */
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -20,7 +20,7 @@
#if defined(MBEDTLS_PKCS5_C)
#include "mbedtls/pkcs5.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_ASN1_PARSE_C)
#include "mbedtls/asn1.h"

View File

@ -14,7 +14,7 @@
#include "mbedtls/oid.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/platform.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/ecp.h"
#include "pk_internal.h"

View File

@ -13,7 +13,7 @@
#include "mbedtls/asn1write.h"
#include "mbedtls/oid.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "pk_internal.h"
#include <string.h>

View File

@ -11,7 +11,7 @@
#include "mbedtls/platform.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
/* The compile time configuration of memory allocation via the macros
* MBEDTLS_PLATFORM_{FREE/CALLOC}_MACRO takes precedence over the runtime

View File

@ -12,7 +12,7 @@
#include "mbedtls/poly1305.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -21,7 +21,7 @@
#include "mbedtls/chachapoly.h"
#include "mbedtls/cipher.h"
#include "mbedtls/gcm.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
static psa_status_t psa_aead_setup(
mbedtls_psa_aead_operation_t *operation,

View File

@ -15,7 +15,7 @@
#include "psa_crypto_random_impl.h"
#include "mbedtls/cipher.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -23,7 +23,7 @@
#include <mbedtls/ecdsa.h>
#include <mbedtls/ecdh.h>
#include <mbedtls/ecp.h>
#include <mbedtls/error.h>
#include <mbedtls/error_common.h>
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_BASIC) || \
defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_ECC_KEY_PAIR_IMPORT) || \

View File

@ -21,7 +21,7 @@
#include "psa_crypto_ffdh.h"
#include "psa_crypto_random_impl.h"
#include "mbedtls/platform.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_KEY_PAIR_EXPORT) || \
defined(MBEDTLS_PSA_BUILTIN_KEY_TYPE_DH_KEY_PAIR_GENERATE) || \

View File

@ -14,7 +14,7 @@
#include "psa_crypto_core.h"
#include "psa_crypto_hash.h"
#include <mbedtls/error.h>
#include <mbedtls/error_common.h>
#include <string.h>
#if defined(MBEDTLS_PSA_BUILTIN_HASH)

View File

@ -16,7 +16,7 @@
#include "psa_crypto_mac.h"
#include <mbedtls/md.h>
#include <mbedtls/error.h>
#include <mbedtls/error_common.h>
#include "mbedtls/constant_time.h"
#include <string.h>

View File

@ -19,7 +19,7 @@
#include "psa_util_internal.h"
#include <mbedtls/platform.h>
#include <mbedtls/error.h>
#include <mbedtls/error_common.h>
#include <string.h>
/*

View File

@ -23,7 +23,7 @@
#include "mbedtls/platform.h"
#include <mbedtls/rsa.h>
#include <mbedtls/error.h>
#include <mbedtls/error_common.h>
#include "rsa_internal.h"
#if defined(MBEDTLS_PSA_BUILTIN_ALG_RSA_PKCS1V15_CRYPT) || \

View File

@ -9,7 +9,7 @@
#include "common.h"
/* This is needed for MBEDTLS_ERR_XXX macros */
#include <mbedtls/error.h>
#include <mbedtls/error_common.h>
#if defined(MBEDTLS_ASN1_WRITE_C)
#include <mbedtls/asn1write.h>

View File

@ -17,7 +17,7 @@
#include "mbedtls/ripemd160.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -35,7 +35,7 @@
#include "mbedtls/oid.h"
#include "mbedtls/asn1write.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "constant_time_internal.h"
#include "mbedtls/constant_time.h"
#include "md_psa.h"

View File

@ -16,7 +16,7 @@
#include "mbedtls/sha1.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -54,7 +54,7 @@
#include "mbedtls/sha256.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -43,7 +43,7 @@
#include "mbedtls/sha3.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include <string.h>

View File

@ -32,7 +32,7 @@
#include "mbedtls/sha512.h"
#include "mbedtls/platform_util.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#if defined(_MSC_VER) || defined(__WATCOMC__)
#define UL64(x) x##ui64

View File

@ -16,8 +16,8 @@
#include <stdlib.h>
#include <string.h>
#if defined(MBEDTLS_ERROR_C)
#include "mbedtls/error.h"
#if defined(MBEDTLS_ERRORCOMMON_C)
#include "mbedtls/error_common.h"
#endif
#include "mbedtls/platform.h"

View File

@ -232,7 +232,7 @@ int main(int argc, const char *argv[])
#if defined(MBEDTLS_TEST_HOOKS)
extern void (*mbedtls_test_hook_test_fail)(const char *test, int line, const char *file);
mbedtls_test_hook_test_fail = &mbedtls_test_fail;
#if defined(MBEDTLS_ERROR_C)
#if defined(MBEDTLS_ERRORCOMMON_C)
mbedtls_test_hook_error_add = &mbedtls_test_err_add_check;
#endif
#endif

View File

@ -1,9 +1,9 @@
/* BEGIN_HEADER */
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
/* END_HEADER */
/* BEGIN_DEPENDENCIES
* depends_on:MBEDTLS_ERROR_C
* depends_on:MBEDTLS_ERRORCOMMON_C
* END_DEPENDENCIES
*/

View File

@ -7,7 +7,7 @@
#include "mbedtls/asn1.h"
#include "mbedtls/base64.h"
#include "mbedtls/ecp.h"
#include "mbedtls/error.h"
#include "mbedtls/error_common.h"
#include "mbedtls/rsa.h"
#include "rsa_internal.h"
#include "pk_internal.h"