From 07018f97d200a8238b566a9a5e6ff5322e2ab6a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 15 Sep 2022 11:29:35 +0200 Subject: [PATCH] Make legacy_or_psa.h public. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As a public header, it should no longer include common.h, just use build_info.h which is what we actually need anyway. Signed-off-by: Manuel Pégourié-Gonnard --- {library => include/mbedtls}/legacy_or_psa.h | 2 +- library/hash_info.c | 2 +- library/oid.c | 2 +- library/pem.c | 2 +- library/ssl_ciphersuites.c | 2 +- library/ssl_cookie.c | 2 +- library/ssl_misc.h | 2 +- library/ssl_tls.c | 2 +- library/x509.c | 2 +- library/x509write_crt.c | 2 +- tests/src/certs.c | 2 +- tests/suites/test_suite_ecdsa.function | 2 +- tests/suites/test_suite_ecjpake.function | 2 +- tests/suites/test_suite_oid.function | 2 +- tests/suites/test_suite_pem.function | 2 +- tests/suites/test_suite_pk.function | 2 +- tests/suites/test_suite_pkcs12.function | 2 +- tests/suites/test_suite_pkcs1_v15.function | 2 +- tests/suites/test_suite_pkcs1_v21.function | 2 +- tests/suites/test_suite_pkcs5.function | 2 +- tests/suites/test_suite_pkparse.function | 2 +- tests/suites/test_suite_rsa.function | 2 +- tests/suites/test_suite_ssl.function | 2 +- tests/suites/test_suite_x509parse.function | 2 +- tests/suites/test_suite_x509write.function | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) rename {library => include/mbedtls}/legacy_or_psa.h (99%) diff --git a/library/legacy_or_psa.h b/include/mbedtls/legacy_or_psa.h similarity index 99% rename from library/legacy_or_psa.h rename to include/mbedtls/legacy_or_psa.h index 47f4e0f27..748075198 100644 --- a/library/legacy_or_psa.h +++ b/include/mbedtls/legacy_or_psa.h @@ -96,7 +96,7 @@ #ifndef MBEDTLS_OR_PSA_HELPERS_H #define MBEDTLS_OR_PSA_HELPERS_H -#include "common.h" +#include "mbedtls/build_info.h" #if defined(MBEDTLS_PSA_CRYPTO_C) #include "psa/crypto.h" #endif /* MBEDTLS_PSA_CRYPTO_C */ diff --git a/library/hash_info.c b/library/hash_info.c index 366ca3f5a..cd7d70e82 100644 --- a/library/hash_info.c +++ b/library/hash_info.c @@ -21,7 +21,7 @@ */ #include "hash_info.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #include "mbedtls/error.h" typedef struct diff --git a/library/oid.c b/library/oid.c index 4ecf62184..dcd181518 100644 --- a/library/oid.c +++ b/library/oid.c @@ -27,7 +27,7 @@ #include "mbedtls/rsa.h" #include "mbedtls/error.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #include #include diff --git a/library/pem.c b/library/pem.c index 8f0aba071..e4101e8f3 100644 --- a/library/pem.c +++ b/library/pem.c @@ -45,7 +45,7 @@ #include "psa/crypto.h" #endif -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if defined(MBEDTLS_HAS_ALG_MD5_VIA_MD_OR_PSA_BASED_ON_USE_PSA) && \ defined(MBEDTLS_CIPHER_MODE_CBC) && \ diff --git a/library/ssl_ciphersuites.c b/library/ssl_ciphersuites.c index dc5044963..808aa9e9e 100644 --- a/library/ssl_ciphersuites.c +++ b/library/ssl_ciphersuites.c @@ -33,7 +33,7 @@ #include "mbedtls/ssl.h" #include "ssl_misc.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #include diff --git a/library/ssl_cookie.c b/library/ssl_cookie.c index 8777833b9..b6a8add2a 100644 --- a/library/ssl_cookie.c +++ b/library/ssl_cookie.c @@ -38,7 +38,7 @@ #include "mbedtls/platform_util.h" #include "mbedtls/constant_time.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #include diff --git a/library/ssl_misc.h b/library/ssl_misc.h index a59e672ef..edbf446ee 100644 --- a/library/ssl_misc.h +++ b/library/ssl_misc.h @@ -32,7 +32,7 @@ #include "mbedtls/psa_util.h" #include "hash_info.h" #endif -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if defined(MBEDTLS_MD5_C) #include "mbedtls/md5.h" diff --git a/library/ssl_tls.c b/library/ssl_tls.c index af65e6d86..12e1c1b03 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -54,7 +54,7 @@ #include "mbedtls/psa_util.h" #include "psa/crypto.h" #endif -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if defined(MBEDTLS_X509_CRT_PARSE_C) #include "mbedtls/oid.h" diff --git a/library/x509.c b/library/x509.c index aa3951799..f1d988aa7 100644 --- a/library/x509.c +++ b/library/x509.c @@ -62,7 +62,7 @@ #include #endif -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #define CHECK(code) if( ( ret = ( code ) ) != 0 ){ return( ret ); } #define CHECK_RANGE(min, max, val) \ diff --git a/library/x509write_crt.c b/library/x509write_crt.c index e51a385f6..52942a9e8 100644 --- a/library/x509write_crt.c +++ b/library/x509write_crt.c @@ -46,7 +46,7 @@ #endif /* MBEDTLS_USE_PSA_CRYPTO */ #include "hash_info.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" void mbedtls_x509write_crt_init( mbedtls_x509write_cert *ctx ) { diff --git a/tests/src/certs.c b/tests/src/certs.c index 551602626..ca03b29d4 100644 --- a/tests/src/certs.c +++ b/tests/src/certs.c @@ -23,7 +23,7 @@ #include "mbedtls/build_info.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* * Test CA Certificates diff --git a/tests/suites/test_suite_ecdsa.function b/tests/suites/test_suite_ecdsa.function index 7e1daa25a..e82f39d32 100644 --- a/tests/suites/test_suite_ecdsa.function +++ b/tests/suites/test_suite_ecdsa.function @@ -1,7 +1,7 @@ /* BEGIN_HEADER */ #include "mbedtls/ecdsa.h" #include "hash_info.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if ( defined(MBEDTLS_ECDSA_DETERMINISTIC) && defined(MBEDTLS_SHA256_C) ) || \ ( !defined(MBEDTLS_ECDSA_DETERMINISTIC) && defined(MBEDTLS_HAS_ALG_SHA_256_VIA_LOWLEVEL_OR_PSA) ) #define MBEDTLS_HAS_ALG_SHA_256_VIA_MD_IF_DETERMINISTIC diff --git a/tests/suites/test_suite_ecjpake.function b/tests/suites/test_suite_ecjpake.function index 449b36891..47c25e3ae 100644 --- a/tests/suites/test_suite_ecjpake.function +++ b/tests/suites/test_suite_ecjpake.function @@ -1,6 +1,6 @@ /* BEGIN_HEADER */ #include "mbedtls/ecjpake.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if defined(MBEDTLS_ECP_DP_SECP256R1_ENABLED) && defined(MBEDTLS_HAS_ALG_SHA_256_VIA_MD_OR_PSA) static const unsigned char ecjpake_test_x1[] = { diff --git a/tests/suites/test_suite_oid.function b/tests/suites/test_suite_oid.function index 33a9131f9..b06f52410 100644 --- a/tests/suites/test_suite_oid.function +++ b/tests/suites/test_suite_oid.function @@ -3,7 +3,7 @@ #include "mbedtls/asn1.h" #include "mbedtls/asn1write.h" #include "string.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ /* BEGIN_DEPENDENCIES diff --git a/tests/suites/test_suite_pem.function b/tests/suites/test_suite_pem.function index f4ac368e8..632824727 100644 --- a/tests/suites/test_suite_pem.function +++ b/tests/suites/test_suite_pem.function @@ -3,7 +3,7 @@ #include "mbedtls/pem.h" #include "mbedtls/des.h" #include "mbedtls/aes.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ diff --git a/tests/suites/test_suite_pk.function b/tests/suites/test_suite_pk.function index 9c0456032..91fe8695b 100644 --- a/tests/suites/test_suite_pk.function +++ b/tests/suites/test_suite_pk.function @@ -8,7 +8,7 @@ #include "mbedtls/rsa.h" #include "hash_info.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #include #include diff --git a/tests/suites/test_suite_pkcs12.function b/tests/suites/test_suite_pkcs12.function index 34ef090ba..841bd1d6e 100644 --- a/tests/suites/test_suite_pkcs12.function +++ b/tests/suites/test_suite_pkcs12.function @@ -2,7 +2,7 @@ #include "mbedtls/pkcs12.h" #include "common.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" typedef enum { diff --git a/tests/suites/test_suite_pkcs1_v15.function b/tests/suites/test_suite_pkcs1_v15.function index 463e401fb..0fad7c600 100644 --- a/tests/suites/test_suite_pkcs1_v15.function +++ b/tests/suites/test_suite_pkcs1_v15.function @@ -2,7 +2,7 @@ #include "mbedtls/rsa.h" #include "mbedtls/md.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ /* BEGIN_DEPENDENCIES diff --git a/tests/suites/test_suite_pkcs1_v21.function b/tests/suites/test_suite_pkcs1_v21.function index a7e93aafc..593c047f2 100644 --- a/tests/suites/test_suite_pkcs1_v21.function +++ b/tests/suites/test_suite_pkcs1_v21.function @@ -1,6 +1,6 @@ /* BEGIN_HEADER */ #include "mbedtls/rsa.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ /* BEGIN_DEPENDENCIES diff --git a/tests/suites/test_suite_pkcs5.function b/tests/suites/test_suite_pkcs5.function index fcbf9b195..7b7ed3d01 100644 --- a/tests/suites/test_suite_pkcs5.function +++ b/tests/suites/test_suite_pkcs5.function @@ -1,6 +1,6 @@ /* BEGIN_HEADER */ #include "mbedtls/pkcs5.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ /* BEGIN_DEPENDENCIES diff --git a/tests/suites/test_suite_pkparse.function b/tests/suites/test_suite_pkparse.function index 8ca3aca79..c5e60ee38 100644 --- a/tests/suites/test_suite_pkparse.function +++ b/tests/suites/test_suite_pkparse.function @@ -2,7 +2,7 @@ #include "mbedtls/pk.h" #include "mbedtls/pem.h" #include "mbedtls/oid.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ /* BEGIN_DEPENDENCIES diff --git a/tests/suites/test_suite_rsa.function b/tests/suites/test_suite_rsa.function index 0c8887a6f..a866d432d 100644 --- a/tests/suites/test_suite_rsa.function +++ b/tests/suites/test_suite_rsa.function @@ -2,7 +2,7 @@ #include "mbedtls/rsa.h" #include "rsa_alt_helpers.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" /* END_HEADER */ /* BEGIN_DEPENDENCIES diff --git a/tests/suites/test_suite_ssl.function b/tests/suites/test_suite_ssl.function index 26855a613..0d5cea1b7 100644 --- a/tests/suites/test_suite_ssl.function +++ b/tests/suites/test_suite_ssl.function @@ -11,7 +11,7 @@ #include "mbedtls/ssl_cache.h" #endif -#include +#include #include "hash_info.h" #include diff --git a/tests/suites/test_suite_x509parse.function b/tests/suites/test_suite_x509parse.function index b650afd0d..60e703a94 100644 --- a/tests/suites/test_suite_x509parse.function +++ b/tests/suites/test_suite_x509parse.function @@ -10,7 +10,7 @@ #include "mbedtls/error.h" #include "string.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if MBEDTLS_X509_MAX_INTERMEDIATE_CA > 19 #error "The value of MBEDTLS_X509_MAX_INTERMEDIATE_C is larger \ diff --git a/tests/suites/test_suite_x509write.function b/tests/suites/test_suite_x509write.function index 5a9724080..1120bee14 100644 --- a/tests/suites/test_suite_x509write.function +++ b/tests/suites/test_suite_x509write.function @@ -7,7 +7,7 @@ #include "mbedtls/rsa.h" #include "hash_info.h" -#include "legacy_or_psa.h" +#include "mbedtls/legacy_or_psa.h" #if defined(MBEDTLS_RSA_C) int mbedtls_rsa_decrypt_func( void *ctx, size_t *olen,