diff --git a/library/pkcs7.c b/library/pkcs7.c index 3aac662ba..9b53ceea3 100644 --- a/library/pkcs7.c +++ b/library/pkcs7.c @@ -2,12 +2,11 @@ * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "x509_internal.h" #include "mbedtls/build_info.h" #if defined(MBEDTLS_PKCS7_C) #include "mbedtls/pkcs7.h" -#include "x509_internal.h" #include "mbedtls/asn1.h" #include "mbedtls/x509_crt.h" #include "mbedtls/x509_crl.h" diff --git a/library/ssl_cache.c b/library/ssl_cache.c index 772cb8fdf..28d0cfbb7 100644 --- a/library/ssl_cache.c +++ b/library/ssl_cache.c @@ -9,14 +9,13 @@ * to store and retrieve the session information. */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_CACHE_C) #include "mbedtls/platform.h" #include "mbedtls/ssl_cache.h" -#include "ssl_misc.h" #include "mbedtls/error.h" #include diff --git a/library/ssl_ciphersuites.c b/library/ssl_ciphersuites.c index 402c1355c..149595083 100644 --- a/library/ssl_ciphersuites.c +++ b/library/ssl_ciphersuites.c @@ -7,7 +7,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_TLS_C) diff --git a/library/ssl_client.c b/library/ssl_client.c index 345e60893..823708173 100644 --- a/library/ssl_client.c +++ b/library/ssl_client.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_CLI_C) #if defined(MBEDTLS_SSL_PROTO_TLS1_3) || defined(MBEDTLS_SSL_PROTO_TLS1_2) @@ -17,7 +17,6 @@ #include "mbedtls/platform.h" #include "ssl_client.h" -#include "ssl_misc.h" #include "ssl_tls13_keys.h" #include "ssl_debug_helpers.h" diff --git a/library/ssl_client.h b/library/ssl_client.h index 05ee7e4cc..56e9bf857 100644 --- a/library/ssl_client.h +++ b/library/ssl_client.h @@ -8,11 +8,7 @@ #ifndef MBEDTLS_SSL_CLIENT_H #define MBEDTLS_SSL_CLIENT_H -#include "common.h" - -#if defined(MBEDTLS_SSL_TLS_C) #include "ssl_misc.h" -#endif #include diff --git a/library/ssl_cookie.c b/library/ssl_cookie.c index cba513d4f..0e374671c 100644 --- a/library/ssl_cookie.c +++ b/library/ssl_cookie.c @@ -9,14 +9,13 @@ * to store and retrieve the session information. */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_COOKIE_C) #include "mbedtls/platform.h" #include "mbedtls/ssl_cookie.h" -#include "ssl_misc.h" #include "mbedtls/error.h" #include "mbedtls/platform_util.h" #include "mbedtls/constant_time.h" diff --git a/library/ssl_debug_helpers.h b/library/ssl_debug_helpers.h index 4889e77e0..6f843404c 100644 --- a/library/ssl_debug_helpers.h +++ b/library/ssl_debug_helpers.h @@ -11,13 +11,11 @@ #ifndef MBEDTLS_SSL_DEBUG_HELPERS_H #define MBEDTLS_SSL_DEBUG_HELPERS_H -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_DEBUG_C) #include "mbedtls/ssl.h" -#include "ssl_misc.h" - const char *mbedtls_ssl_states_str(mbedtls_ssl_states in); diff --git a/library/ssl_misc.h b/library/ssl_misc.h index 47e56e879..48bc69c0b 100644 --- a/library/ssl_misc.h +++ b/library/ssl_misc.h @@ -10,6 +10,7 @@ #ifndef MBEDTLS_SSL_MISC_H #define MBEDTLS_SSL_MISC_H +#include "common.h" #include "mbedtls/build_info.h" #include "mbedtls/error.h" diff --git a/library/ssl_msg.c b/library/ssl_msg.c index 0165fd639..7000e93e5 100644 --- a/library/ssl_msg.c +++ b/library/ssl_msg.c @@ -10,14 +10,13 @@ * http://www.ietf.org/rfc/rfc4346.txt */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_TLS_C) #include "mbedtls/platform.h" #include "mbedtls/ssl.h" -#include "ssl_misc.h" #include "debug_internal.h" #include "mbedtls/error.h" #include "mbedtls/platform_util.h" diff --git a/library/ssl_ticket.c b/library/ssl_ticket.c index bfb656cf6..615b37fd6 100644 --- a/library/ssl_ticket.c +++ b/library/ssl_ticket.c @@ -5,13 +5,12 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_TICKET_C) #include "mbedtls/platform.h" -#include "ssl_misc.h" #include "mbedtls/ssl_ticket.h" #include "mbedtls/error.h" #include "mbedtls/platform_util.h" diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 62472484d..39c7a2e3c 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -9,7 +9,7 @@ * http://www.ietf.org/rfc/rfc4346.txt */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_TLS_C) @@ -18,7 +18,6 @@ #include "mbedtls/ssl.h" #include "ssl_client.h" #include "ssl_debug_helpers.h" -#include "ssl_misc.h" #include "debug_internal.h" #include "mbedtls/error.h" diff --git a/library/ssl_tls12_client.c b/library/ssl_tls12_client.c index eac6a3aad..0affc91c4 100644 --- a/library/ssl_tls12_client.c +++ b/library/ssl_tls12_client.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_CLI_C) && defined(MBEDTLS_SSL_PROTO_TLS1_2) @@ -13,7 +13,6 @@ #include "mbedtls/ssl.h" #include "ssl_client.h" -#include "ssl_misc.h" #include "debug_internal.h" #include "mbedtls/error.h" #include "mbedtls/constant_time.h" diff --git a/library/ssl_tls12_server.c b/library/ssl_tls12_server.c index 03722ac33..76200be61 100644 --- a/library/ssl_tls12_server.c +++ b/library/ssl_tls12_server.c @@ -5,14 +5,13 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_SRV_C) && defined(MBEDTLS_SSL_PROTO_TLS1_2) #include "mbedtls/platform.h" #include "mbedtls/ssl.h" -#include "ssl_misc.h" #include "debug_internal.h" #include "mbedtls/error.h" #include "mbedtls/platform_util.h" diff --git a/library/ssl_tls13_client.c b/library/ssl_tls13_client.c index 162e3a314..53c519c4b 100644 --- a/library/ssl_tls13_client.c +++ b/library/ssl_tls13_client.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_CLI_C) && defined(MBEDTLS_SSL_PROTO_TLS1_3) @@ -15,7 +15,6 @@ #include "mbedtls/error.h" #include "mbedtls/platform.h" -#include "ssl_misc.h" #include "ssl_client.h" #include "ssl_tls13_keys.h" #include "ssl_debug_helpers.h" diff --git a/library/ssl_tls13_generic.c b/library/ssl_tls13_generic.c index 3f1f551dd..6a7d50272 100644 --- a/library/ssl_tls13_generic.c +++ b/library/ssl_tls13_generic.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_TLS_C) && defined(MBEDTLS_SSL_PROTO_TLS1_3) @@ -19,7 +19,6 @@ #include "psa/crypto.h" #include "mbedtls/psa_util.h" -#include "ssl_misc.h" #include "ssl_tls13_invasive.h" #include "ssl_tls13_keys.h" #include "ssl_debug_helpers.h" diff --git a/library/ssl_tls13_invasive.h b/library/ssl_tls13_invasive.h index b4506f71c..73e0e304f 100644 --- a/library/ssl_tls13_invasive.h +++ b/library/ssl_tls13_invasive.h @@ -6,7 +6,7 @@ #ifndef MBEDTLS_SSL_TLS13_INVASIVE_H #define MBEDTLS_SSL_TLS13_INVASIVE_H -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_PROTO_TLS1_3) diff --git a/library/ssl_tls13_keys.c b/library/ssl_tls13_keys.c index 739414ea2..96aad1c4b 100644 --- a/library/ssl_tls13_keys.c +++ b/library/ssl_tls13_keys.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_PROTO_TLS1_3) @@ -17,7 +17,6 @@ #include "mbedtls/error.h" #include "mbedtls/platform.h" -#include "ssl_misc.h" #include "ssl_tls13_keys.h" #include "ssl_tls13_invasive.h" diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c index 9c949bd0b..ab27c94ef 100644 --- a/library/ssl_tls13_server.c +++ b/library/ssl_tls13_server.c @@ -5,7 +5,7 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "ssl_misc.h" #if defined(MBEDTLS_SSL_SRV_C) && defined(MBEDTLS_SSL_PROTO_TLS1_3) @@ -16,7 +16,6 @@ #include "mbedtls/oid.h" #include "mbedtls/psa_util.h" -#include "ssl_misc.h" #include "ssl_tls13_keys.h" #include "ssl_debug_helpers.h" diff --git a/library/x509.c b/library/x509.c index be7b277bb..0571687da 100644 --- a/library/x509.c +++ b/library/x509.c @@ -15,11 +15,10 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_USE_C) -#include "x509_internal.h" #include "mbedtls/asn1.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" diff --git a/library/x509_create.c b/library/x509_create.c index 130983189..48ac080cb 100644 --- a/library/x509_create.c +++ b/library/x509_create.c @@ -5,11 +5,10 @@ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_CREATE_C) -#include "x509_internal.h" #include "mbedtls/asn1write.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" diff --git a/library/x509_crl.c b/library/x509_crl.c index 7901992e2..e67fde721 100644 --- a/library/x509_crl.c +++ b/library/x509_crl.c @@ -15,12 +15,11 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_CRL_PARSE_C) #include "mbedtls/x509_crl.h" -#include "x509_internal.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" #include "mbedtls/platform_util.h" diff --git a/library/x509_crt.c b/library/x509_crt.c index 1de1ee64c..00f310739 100644 --- a/library/x509_crt.c +++ b/library/x509_crt.c @@ -17,12 +17,11 @@ * [SIRO] https://cabforum.org/wp-content/uploads/Chunghwatelecom201503cabforumV4.pdf */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_CRT_PARSE_C) #include "mbedtls/x509_crt.h" -#include "x509_internal.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" #include "mbedtls/platform_util.h" diff --git a/library/x509_csr.c b/library/x509_csr.c index 813d64466..3a7826868 100644 --- a/library/x509_csr.c +++ b/library/x509_csr.c @@ -15,12 +15,11 @@ * http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_CSR_PARSE_C) #include "mbedtls/x509_csr.h" -#include "x509_internal.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" #include "mbedtls/platform_util.h" diff --git a/library/x509_internal.h b/library/x509_internal.h index 78c529341..1ec808a2e 100644 --- a/library/x509_internal.h +++ b/library/x509_internal.h @@ -9,10 +9,11 @@ */ #ifndef MBEDTLS_X509_INTERNAL_H #define MBEDTLS_X509_INTERNAL_H + +#include "common.h" #include "mbedtls/private_access.h" #include "mbedtls/build_info.h" -#include "common.h" #include "mbedtls/x509.h" #include "mbedtls/asn1.h" diff --git a/library/x509write.c b/library/x509write.c index 4704900d3..8288c892b 100644 --- a/library/x509write.c +++ b/library/x509write.c @@ -4,11 +4,11 @@ * Copyright The Mbed TLS Contributors * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later */ -#include "common.h" +#include "x509_internal.h" + #if defined(MBEDTLS_X509_CSR_WRITE_C) || defined(MBEDTLS_X509_CRT_WRITE_C) #include "mbedtls/x509_crt.h" -#include "x509_internal.h" #include "mbedtls/asn1write.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" diff --git a/library/x509write_crt.c b/library/x509write_crt.c index ce9e4a610..8bce1ccf5 100644 --- a/library/x509write_crt.c +++ b/library/x509write_crt.c @@ -11,12 +11,11 @@ * - attributes: PKCS#9 v2.0 aka RFC 2985 */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_CRT_WRITE_C) #include "mbedtls/x509_crt.h" -#include "x509_internal.h" #include "mbedtls/asn1write.h" #include "mbedtls/error.h" #include "mbedtls/oid.h" diff --git a/library/x509write_csr.c b/library/x509write_csr.c index 0d6f6bb1d..604c94c3e 100644 --- a/library/x509write_csr.c +++ b/library/x509write_csr.c @@ -10,11 +10,10 @@ * - attributes: PKCS#9 v2.0 aka RFC 2985 */ -#include "common.h" +#include "x509_internal.h" #if defined(MBEDTLS_X509_CSR_WRITE_C) -#include "x509_internal.h" #include "mbedtls/x509_csr.h" #include "mbedtls/asn1write.h" #include "mbedtls/error.h"