Skip to content

Commit

Permalink
Update includes for each library file
Browse files Browse the repository at this point in the history
Signed-off-by: Harry Ramsey <harry.ramsey@arm.com>
  • Loading branch information
Harry-Ramsey committed Oct 9, 2024
1 parent 91c6d4f commit 0f6bc41
Show file tree
Hide file tree
Showing 27 changed files with 28 additions and 52 deletions.
3 changes: 1 addition & 2 deletions library/pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_ciphersuites.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions library/ssl_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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"

Expand Down
4 changes: 0 additions & 4 deletions library/ssl_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down
3 changes: 1 addition & 2 deletions library/ssl_cookie.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 1 addition & 3 deletions library/ssl_debug_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
1 change: 1 addition & 0 deletions library/ssl_misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_ticket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* http://www.ietf.org/rfc/rfc4346.txt
*/

#include "common.h"
#include "ssl_misc.h"

#if defined(MBEDTLS_SSL_TLS_C)

Expand All @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls12_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,14 @@
* 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)

#include "mbedtls/platform.h"

#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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls12_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls13_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls13_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_tls13_invasive.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls13_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"

Expand Down
3 changes: 1 addition & 2 deletions library/ssl_tls13_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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"

Expand Down
3 changes: 1 addition & 2 deletions library/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/x509_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/x509_crl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/x509_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/x509_csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 2 additions & 1 deletion library/x509_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions library/x509write.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/x509write_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions library/x509write_csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0f6bc41

Please sign in to comment.