Create a mbedtls_common.h for the project

We already have `x509_internal.h` which is common to all parts of the X.509
library, and `ssl_misc.h` which is common to all parts of the TLS library.
Also create `mbedtls_common.h` which is for the Mbed TLS project as a whole.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2026-01-29 16:20:19 +01:00
parent c2cb8565a5
commit 29d00fa861
4 changed files with 23 additions and 2 deletions

17
library/mbedtls_common.h Normal file
View File

@@ -0,0 +1,17 @@
/**
* \file mbedtls_common.h
*
* \brief Utility macros for internal use in the library
*/
/*
* Copyright The Mbed TLS Contributors
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
#ifndef MBEDTLS_MBEDTLS_COMMON_H
#define MBEDTLS_MBEDTLS_COMMON_H
/* Mbed TLS requires TF-PSA-Crypto internals. */
#include "tf_psa_crypto_common.h"
#endif /* MBEDTLS_MBEDTLS_COMMON_H */

View File

@@ -6,6 +6,10 @@
* SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
*/
/* We are a special snowflake: we don't include "mbedtls_common.h",
* because that would pull <mbedtls/build_info.h> and we need to
* tune the way it works. */
/* Apply the TF-PSA-Crypto configuration first. We need to do this
* before <mbedtls/build_info.h>, because "mbedtls_config_check_before.h"
* needs to run after the crypto config (including derived macros) is

View File

@@ -10,7 +10,7 @@
#ifndef MBEDTLS_SSL_MISC_H
#define MBEDTLS_SSL_MISC_H
#include "tf_psa_crypto_common.h"
#include "mbedtls_common.h"
#include "mbedtls/build_info.h"
#include "mbedtls/error.h"

View File

@@ -10,7 +10,7 @@
#ifndef MBEDTLS_X509_INTERNAL_H
#define MBEDTLS_X509_INTERNAL_H
#include "tf_psa_crypto_common.h"
#include "mbedtls_common.h"
#include "mbedtls/build_info.h"
#include "mbedtls/private_access.h"