Update includes for each library file
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
diff --git a/library/pkcs7.c b/library/pkcs7.c
index 3aac662..9b53cee 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 772cb8f..28d0cfb 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 <string.h>
diff --git a/library/ssl_ciphersuites.c b/library/ssl_ciphersuites.c
index 402c135..1495950 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 345e608..8237081 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 05ee7e4..56e9bf8 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 <stddef.h>
diff --git a/library/ssl_cookie.c b/library/ssl_cookie.c
index cba513d..0e37467 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 4889e77..6f84340 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 47e56e8..48bc69c 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 0165fd6..7000e93 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 bfb656c..615b37f 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 6247248..39c7a2e 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 eac6a3a..0affc91 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 03722ac..76200be 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 162e3a3..53c519c 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 3f1f551..6a7d502 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 b4506f7..73e0e30 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 739414e..96aad1c 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 9c949bd..ab27c94 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 be7b277..0571687 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 1309831..48ac080 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 7901992..e67fde7 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 1de1ee6..00f3107 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 813d644..3a78268 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 78c5293..1ec808a 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 4704900..8288c89 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 ce9e4a6..8bce1cc 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 0d6f6bb..604c94c 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"