1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-10-20 03:32:32 +03:00

Merge pull request #10224 from amtkarm1/task-private-headers

Move private headers to a private directory
This commit is contained in:
Bence Szépkúti
2025-08-29 10:22:43 +00:00
committed by GitHub
37 changed files with 91 additions and 85 deletions

View File

@@ -7,6 +7,12 @@ if(INSTALL_MBEDTLS_HEADERS)
install(FILES ${headers} install(FILES ${headers}
DESTINATION include/mbedtls DESTINATION include/mbedtls
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
file(GLOB private_headers "mbedtls/private/*.h")
install(FILES ${private_headers}
DESTINATION include/mbedtls/private
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
endif(INSTALL_MBEDTLS_HEADERS) endif(INSTALL_MBEDTLS_HEADERS)
# Make mbedtls_config.h available in an out-of-source build. ssl-opt.sh requires it. # Make mbedtls_config.h available in an out-of-source build. ssl-opt.sh requires it.

View File

@@ -74,9 +74,9 @@
*/ */
#define MBEDTLS_CONFIG_FILES_READ #define MBEDTLS_CONFIG_FILES_READ
#include "mbedtls/config_adjust_x509.h" #include "mbedtls/private/config_adjust_x509.h"
#include "mbedtls/config_adjust_ssl.h" #include "mbedtls/private/config_adjust_ssl.h"
/* Indicate that all configuration symbols are set, /* Indicate that all configuration symbols are set,
* even the ones that are calculated programmatically. * even the ones that are calculated programmatically.

View File

@@ -15,7 +15,7 @@
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#if defined(MBEDTLS_ECP_C) #if defined(MBEDTLS_ECP_C)
#include "mbedtls/ecp.h" #include "mbedtls/private/ecp.h"
#endif #endif
#if defined(MBEDTLS_DEBUG_C) #if defined(MBEDTLS_DEBUG_C)

View File

@@ -11,7 +11,7 @@
#define MBEDTLS_ERROR_H #define MBEDTLS_ERROR_H
#include "mbedtls/build_info.h" #include "mbedtls/build_info.h"
#include "mbedtls/error_common.h" #include "mbedtls/private/error_common.h"
#include <stddef.h> #include <stddef.h>

View File

@@ -1,5 +1,5 @@
/** /**
* \file mbedtls/config_adjust_ssl.h * \file mbedtls/private/config_adjust_ssl.h
* \brief Adjust TLS configuration * \brief Adjust TLS configuration
* *
* This is an internal header. Do not include it directly. * This is an internal header. Do not include it directly.

View File

@@ -1,5 +1,5 @@
/** /**
* \file mbedtls/config_adjust_x509.h * \file mbedtls/private/config_adjust_x509.h
* \brief Adjust X.509 configuration * \brief Adjust X.509 configuration
* *
* This is an internal header. Do not include it directly. * This is an internal header. Do not include it directly.

View File

@@ -14,8 +14,8 @@
#include "mbedtls/build_info.h" #include "mbedtls/build_info.h"
#include "mbedtls/bignum.h" #include "mbedtls/private/bignum.h"
#include "mbedtls/ecp.h" #include "mbedtls/private/ecp.h"
#include "mbedtls/ssl_ciphersuites.h" #include "mbedtls/ssl_ciphersuites.h"
@@ -27,7 +27,7 @@
#include "mbedtls/md.h" #include "mbedtls/md.h"
#if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDH_OR_ECDHE_ANY_ENABLED) #if defined(MBEDTLS_KEY_EXCHANGE_SOME_ECDH_OR_ECDHE_ANY_ENABLED)
#include "mbedtls/ecdh.h" #include "mbedtls/private/ecdh.h"
#endif #endif
#if defined(MBEDTLS_HAVE_TIME) #if defined(MBEDTLS_HAVE_TIME)

View File

@@ -14,7 +14,7 @@
#include "mbedtls/build_info.h" #include "mbedtls/build_info.h"
#include "mbedtls/pk.h" #include "mbedtls/pk.h"
#include "mbedtls/cipher.h" #include "mbedtls/private/cipher.h"
#include "mbedtls/md.h" #include "mbedtls/md.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -17,7 +17,7 @@
#include "mbedtls/pk.h" #include "mbedtls/pk.h"
#if defined(MBEDTLS_RSA_C) #if defined(MBEDTLS_RSA_C)
#include "mbedtls/rsa.h" #include "mbedtls/private/rsa.h"
#endif #endif
/** /**

View File

@@ -15,7 +15,7 @@
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/x509_crl.h" #include "mbedtls/x509_crl.h"
#include "mbedtls/bignum.h" #include "mbedtls/private/bignum.h"
/** /**
* \addtogroup x509_module * \addtogroup x509_module

View File

@@ -19,26 +19,26 @@
#include "mbedtls/debug.h" #include "mbedtls/debug.h"
#include "debug_internal.h" #include "debug_internal.h"
#include "mbedtls/cipher.h" #include "mbedtls/private/cipher.h"
#include "psa/crypto.h" #include "psa/crypto.h"
#include "psa_util_internal.h" #include "psa_util_internal.h"
extern const mbedtls_error_pair_t psa_to_ssl_errors[7]; extern const mbedtls_error_pair_t psa_to_ssl_errors[7];
#if defined(PSA_WANT_ALG_MD5) #if defined(PSA_WANT_ALG_MD5)
#include "mbedtls/md5.h" #include "mbedtls/private/md5.h"
#endif #endif
#if defined(PSA_WANT_ALG_SHA_1) #if defined(PSA_WANT_ALG_SHA_1)
#include "mbedtls/sha1.h" #include "mbedtls/private/sha1.h"
#endif #endif
#if defined(PSA_WANT_ALG_SHA_256) #if defined(PSA_WANT_ALG_SHA_256)
#include "mbedtls/sha256.h" #include "mbedtls/private/sha256.h"
#endif #endif
#if defined(PSA_WANT_ALG_SHA_512) #if defined(PSA_WANT_ALG_SHA_512)
#include "mbedtls/sha512.h" #include "mbedtls/private/sha512.h"
#endif #endif
#include "mbedtls/pk.h" #include "mbedtls/pk.h"

View File

@@ -34,7 +34,7 @@ static int local_err_translation(psa_status_t status)
#endif #endif
#if defined(MBEDTLS_ECP_C) #if defined(MBEDTLS_ECP_C)
#include "mbedtls/ecp.h" #include "mbedtls/private/ecp.h"
#endif #endif
#if defined(MBEDTLS_HAVE_TIME) #if defined(MBEDTLS_HAVE_TIME)

View File

@@ -19,7 +19,7 @@
#include "pk_internal.h" #include "pk_internal.h"
#if defined(MBEDTLS_RSA_C) #if defined(MBEDTLS_RSA_C)
#include "mbedtls/rsa.h" #include "mbedtls/private/rsa.h"
#endif #endif
int mbedtls_x509_get_name(unsigned char **p, const unsigned char *end, int mbedtls_x509_get_name(unsigned char **p, const unsigned char *end,

View File

@@ -1,8 +1,8 @@
#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS #define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "test/certs.h" #include "test/certs.h"
#include "fuzz_common.h" #include "fuzz_common.h"
#include <string.h> #include <string.h>

View File

@@ -6,8 +6,8 @@
#include "fuzz_common.h" #include "fuzz_common.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#if defined(MBEDTLS_SSL_PROTO_DTLS) #if defined(MBEDTLS_SSL_PROTO_DTLS)
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/timing.h" #include "mbedtls/timing.h"
#include "test/certs.h" #include "test/certs.h"

View File

@@ -7,8 +7,8 @@
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "test/certs.h" #include "test/certs.h"
#if defined(MBEDTLS_SSL_PROTO_DTLS) #if defined(MBEDTLS_SSL_PROTO_DTLS)
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/timing.h" #include "mbedtls/timing.h"
#include "mbedtls/ssl_cookie.h" #include "mbedtls/ssl_cookie.h"

View File

@@ -1,8 +1,8 @@
#define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS #define MBEDTLS_DECLARE_PRIVATE_IDENTIFIERS
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/ssl_ticket.h" #include "mbedtls/ssl_ticket.h"
#include "test/certs.h" #include "test/certs.h"
#include "fuzz_common.h" #include "fuzz_common.h"

View File

@@ -31,8 +31,8 @@ int main(void)
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"
#include "mbedtls/debug.h" #include "mbedtls/debug.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/error.h" #include "mbedtls/error.h"
#include "mbedtls/timing.h" #include "mbedtls/timing.h"
#include "test/certs.h" #include "test/certs.h"

View File

@@ -45,8 +45,8 @@ int main(void)
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/ssl_cookie.h" #include "mbedtls/ssl_cookie.h"

View File

@@ -43,8 +43,8 @@ int main(void)
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include <sys/socket.h> #include <sys/socket.h>
#include <netinet/in.h> #include <netinet/in.h>

View File

@@ -27,8 +27,8 @@ int main(void)
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"
#include "mbedtls/debug.h" #include "mbedtls/debug.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/error.h" #include "mbedtls/error.h"
#include "test/certs.h" #include "test/certs.h"

View File

@@ -31,8 +31,8 @@ int main(void)
} }
#else #else
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "test/certs.h" #include "test/certs.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"

View File

@@ -38,8 +38,8 @@ int main(void)
#include "mbedtls/error.h" #include "mbedtls/error.h"
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "test/certs.h" #include "test/certs.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"

View File

@@ -38,8 +38,8 @@ int main(void)
#include <windows.h> #include <windows.h>
#endif #endif
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"

View File

@@ -31,8 +31,8 @@ int main(void)
#include <windows.h> #include <windows.h>
#endif #endif
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"

View File

@@ -43,9 +43,9 @@
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/ssl_ciphersuites.h" #include "mbedtls/ssl_ciphersuites.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/hmac_drbg.h" #include "mbedtls/private/hmac_drbg.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/error.h" #include "mbedtls/error.h"
#include "mbedtls/debug.h" #include "mbedtls/debug.h"

View File

@@ -9,31 +9,31 @@
#include "mbedtls/build_info.h" #include "mbedtls/build_info.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/hmac_drbg.h" #include "mbedtls/private/hmac_drbg.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/gcm.h" #include "mbedtls/private/gcm.h"
#include "mbedtls/ccm.h" #include "mbedtls/private/ccm.h"
#include "mbedtls/cmac.h" #include "mbedtls/private/cmac.h"
#include "mbedtls/md5.h" #include "mbedtls/private/md5.h"
#include "mbedtls/ripemd160.h" #include "mbedtls/private/ripemd160.h"
#include "mbedtls/sha1.h" #include "mbedtls/private/sha1.h"
#include "mbedtls/sha256.h" #include "mbedtls/private/sha256.h"
#include "mbedtls/sha512.h" #include "mbedtls/private/sha512.h"
#include "mbedtls/sha3.h" #include "mbedtls/private/sha3.h"
#include "mbedtls/aes.h" #include "mbedtls/private/aes.h"
#include "mbedtls/camellia.h" #include "mbedtls/private/camellia.h"
#include "mbedtls/aria.h" #include "mbedtls/private/aria.h"
#include "mbedtls/chacha20.h" #include "mbedtls/private/chacha20.h"
#include "mbedtls/poly1305.h" #include "mbedtls/private/poly1305.h"
#include "mbedtls/chachapoly.h" #include "mbedtls/private/chachapoly.h"
#include "mbedtls/base64.h" #include "mbedtls/base64.h"
#include "mbedtls/bignum.h" #include "mbedtls/private/bignum.h"
#include "mbedtls/rsa.h" #include "mbedtls/private/rsa.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/pkcs5.h" #include "mbedtls/private/pkcs5.h"
#include "mbedtls/ecp.h" #include "mbedtls/private/ecp.h"
#include "mbedtls/ecjpake.h" #include "mbedtls/private/ecjpake.h"
#include "mbedtls/timing.h" #include "mbedtls/timing.h"
#include "mbedtls/nist_kw.h" #include "mbedtls/nist_kw.h"
#include "mbedtls/debug.h" #include "mbedtls/debug.h"

View File

@@ -27,8 +27,8 @@ int main(void)
} }
#else #else
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/net_sockets.h" #include "mbedtls/net_sockets.h"
#include "mbedtls/ssl.h" #include "mbedtls/ssl.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"

View File

@@ -29,8 +29,8 @@ int main(void)
#else #else
#include "mbedtls/x509_csr.h" #include "mbedtls/x509_csr.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/error.h" #include "mbedtls/error.h"
#include <stdio.h> #include <stdio.h>

View File

@@ -31,8 +31,8 @@ int main(void)
#include "mbedtls/x509_crt.h" #include "mbedtls/x509_crt.h"
#include "mbedtls/x509_csr.h" #include "mbedtls/x509_csr.h"
#include "mbedtls/oid.h" #include "mbedtls/oid.h"
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#include "mbedtls/ctr_drbg.h" #include "mbedtls/private/ctr_drbg.h"
#include "mbedtls/error.h" #include "mbedtls/error.h"
#include "test/helpers.h" #include "test/helpers.h"

View File

@@ -10,7 +10,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include "mbedtls/entropy.h" #include "mbedtls/private/entropy.h"
#define BUFFER_SIZE 100 #define BUFFER_SIZE 100

View File

@@ -22,8 +22,8 @@ my $private_files_regex = join('|', map { quotemeta($_) } @private_files);
while (<>) { while (<>) {
s!^(\s*#\s*include\s*[\"<])mbedtls/build_info.h!${1}libtestdriver1/include/mbedtls/build_info.h!; s!^(\s*#\s*include\s*[\"<])mbedtls/build_info.h!${1}libtestdriver1/include/mbedtls/build_info.h!;
s!^(\s*#\s*include\s*[\"<])mbedtls/mbedtls_config.h!${1}libtestdriver1/include/mbedtls/mbedtls_config.h!; s!^(\s*#\s*include\s*[\"<])mbedtls/mbedtls_config.h!${1}libtestdriver1/include/mbedtls/mbedtls_config.h!;
s!^(\s*#\s*include\s*[\"<])mbedtls/config_adjust_x509.h!${1}libtestdriver1/include/mbedtls/config_adjust_x509.h!; s!^(\s*#\s*include\s*[\"<])mbedtls/private/config_adjust_x509.h!${1}libtestdriver1/include/mbedtls/private/config_adjust_x509.h!;
s!^(\s*#\s*include\s*[\"<])mbedtls/config_adjust_ssl.h!${1}libtestdriver1/include/mbedtls/config_adjust_ssl.h!; s!^(\s*#\s*include\s*[\"<])mbedtls/private/config_adjust_ssl.h!${1}libtestdriver1/include/mbedtls/private/config_adjust_ssl.h!;
s!^(\s*#\s*include\s*[\"<])mbedtls/check_config.h!${1}libtestdriver1/include/mbedtls/check_config.h!; s!^(\s*#\s*include\s*[\"<])mbedtls/check_config.h!${1}libtestdriver1/include/mbedtls/check_config.h!;
# Files in include/mbedtls and drivers/builtin/include/mbedtls are both # Files in include/mbedtls and drivers/builtin/include/mbedtls are both
# included in files via #include mbedtls/<file>.h, so when expanding to the # included in files via #include mbedtls/<file>.h, so when expanding to the

View File

@@ -1,5 +1,5 @@
/* BEGIN_HEADER */ /* BEGIN_HEADER */
#include "mbedtls/bignum.h" #include "mbedtls/private/bignum.h"
#include "mbedtls/pkcs7.h" #include "mbedtls/pkcs7.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/x509_crt.h" #include "mbedtls/x509_crt.h"
@@ -8,7 +8,7 @@
#include "mbedtls/oid.h" #include "mbedtls/oid.h"
#include "sys/types.h" #include "sys/types.h"
#include "sys/stat.h" #include "sys/stat.h"
#include "mbedtls/rsa.h" #include "mbedtls/private/rsa.h"
#include "mbedtls/error.h" #include "mbedtls/error.h"
/* END_HEADER */ /* END_HEADER */

View File

@@ -1,5 +1,5 @@
/* BEGIN_HEADER */ /* BEGIN_HEADER */
#include "mbedtls/bignum.h" #include "mbedtls/private/bignum.h"
#include "mbedtls/x509.h" #include "mbedtls/x509.h"
#include "mbedtls/x509_crt.h" #include "mbedtls/x509_crt.h"
#include "mbedtls/x509_crl.h" #include "mbedtls/x509_crl.h"

View File

@@ -1,12 +1,12 @@
/* BEGIN_HEADER */ /* BEGIN_HEADER */
#include "mbedtls/bignum.h" #include "mbedtls/private/bignum.h"
#include "mbedtls/x509_crt.h" #include "mbedtls/x509_crt.h"
#include "mbedtls/x509_csr.h" #include "mbedtls/x509_csr.h"
#include "x509_internal.h" #include "x509_internal.h"
#include "mbedtls/pem.h" #include "mbedtls/pem.h"
#include "mbedtls/oid.h" #include "mbedtls/oid.h"
#include "x509_oid.h" #include "x509_oid.h"
#include "mbedtls/rsa.h" #include "mbedtls/private/rsa.h"
#include "mbedtls/asn1.h" #include "mbedtls/asn1.h"
#include "mbedtls/asn1write.h" #include "mbedtls/asn1write.h"
#include "mbedtls/pk.h" #include "mbedtls/pk.h"