From 7871cb14a731453df99c2ef9ea2a4338da4a07b0 Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Tue, 10 Oct 2023 08:51:39 +0200 Subject: [PATCH] Include psa/build_info.h instead of mbedtls/build_info.h In PSA headers include psa/build_info.h instead of mbedtls/build_info.h. In Mbed TLS, both are equivalent but not in TF-PSA-Crypto where psa/build_info.h is the correct one. Signed-off-by: Ronald Cron --- include/psa/crypto_platform.h | 2 +- include/psa/crypto_sizes.h | 2 +- include/psa/crypto_struct.h | 11 ++++++++--- include/psa/crypto_types.h | 11 +++++++++-- library/psa_crypto_core.h | 9 ++++++++- library/psa_crypto_invasive.h | 9 ++++++++- library/psa_crypto_se.h | 9 ++++++++- 7 files changed, 43 insertions(+), 10 deletions(-) diff --git a/include/psa/crypto_platform.h b/include/psa/crypto_platform.h index bd469c7201..8c81ded34c 100644 --- a/include/psa/crypto_platform.h +++ b/include/psa/crypto_platform.h @@ -35,7 +35,7 @@ #include "mbedtls/private_access.h" /* - * Include the build-time configuration information file. Here, we do not + * Include the build-time configuration information header. Here, we do not * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which * is basically just an alias to it. This is to ease the maintenance of the * TF-PSA-Crypto repository which has a different build system and diff --git a/include/psa/crypto_sizes.h b/include/psa/crypto_sizes.h index 5ced47feb7..31e45fe6a8 100644 --- a/include/psa/crypto_sizes.h +++ b/include/psa/crypto_sizes.h @@ -41,7 +41,7 @@ #define PSA_CRYPTO_SIZES_H /* - * Include the build-time configuration information file. Here, we do not + * Include the build-time configuration information header. Here, we do not * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which * is basically just an alias to it. This is to ease the maintenance of the * TF-PSA-Crypto repository which has a different build system and diff --git a/include/psa/crypto_struct.h b/include/psa/crypto_struct.h index b309bc854c..6c461914db 100644 --- a/include/psa/crypto_struct.h +++ b/include/psa/crypto_struct.h @@ -66,9 +66,14 @@ extern "C" { #endif -/* Include the Mbed TLS configuration file, the way Mbed TLS does it - * in each of its header files. */ -#include "mbedtls/build_info.h" +/* + * Include the build-time configuration information header. Here, we do not + * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which + * is basically just an alias to it. This is to ease the maintenance of the + * TF-PSA-Crypto repository which has a different build system and + * configuration. + */ +#include "psa/build_info.h" /* Include the context definition for the compiled-in drivers for the primitive * algorithms. */ diff --git a/include/psa/crypto_types.h b/include/psa/crypto_types.h index 445657eb95..8d894b4705 100644 --- a/include/psa/crypto_types.h +++ b/include/psa/crypto_types.h @@ -33,8 +33,15 @@ #ifndef PSA_CRYPTO_TYPES_H #define PSA_CRYPTO_TYPES_H -/* Make sure the Mbed TLS configuration is visible. */ -#include "mbedtls/build_info.h" +/* + * Include the build-time configuration information header. Here, we do not + * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which + * is basically just an alias to it. This is to ease the maintenance of the + * TF-PSA-Crypto repository which has a different build system and + * configuration. + */ +#include "psa/build_info.h" + /* Define the MBEDTLS_PRIVATE macro. */ #include "mbedtls/private_access.h" diff --git a/library/psa_crypto_core.h b/library/psa_crypto_core.h index 575f302d40..29b3b94bfe 100644 --- a/library/psa_crypto_core.h +++ b/library/psa_crypto_core.h @@ -21,7 +21,14 @@ #ifndef PSA_CRYPTO_CORE_H #define PSA_CRYPTO_CORE_H -#include "mbedtls/build_info.h" +/* + * Include the build-time configuration information header. Here, we do not + * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which + * is basically just an alias to it. This is to ease the maintenance of the + * TF-PSA-Crypto repository which has a different build system and + * configuration. + */ +#include "psa/build_info.h" #include "psa/crypto.h" #include "psa/crypto_se_driver.h" diff --git a/library/psa_crypto_invasive.h b/library/psa_crypto_invasive.h index a900dd8ff7..408c39bfec 100644 --- a/library/psa_crypto_invasive.h +++ b/library/psa_crypto_invasive.h @@ -28,7 +28,14 @@ #ifndef PSA_CRYPTO_INVASIVE_H #define PSA_CRYPTO_INVASIVE_H -#include "mbedtls/build_info.h" +/* + * Include the build-time configuration information header. Here, we do not + * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which + * is basically just an alias to it. This is to ease the maintenance of the + * TF-PSA-Crypto repository which has a different build system and + * configuration. + */ +#include "psa/build_info.h" #include "psa/crypto.h" #include "common.h" diff --git a/library/psa_crypto_se.h b/library/psa_crypto_se.h index a1e5e09225..850ea8f6fe 100644 --- a/library/psa_crypto_se.h +++ b/library/psa_crypto_se.h @@ -21,7 +21,14 @@ #ifndef PSA_CRYPTO_SE_H #define PSA_CRYPTO_SE_H -#include "mbedtls/build_info.h" +/* + * Include the build-time configuration information header. Here, we do not + * include `"mbedtls/build_info.h"` directly but `"psa/build_info.h"`, which + * is basically just an alias to it. This is to ease the maintenance of the + * TF-PSA-Crypto repository which has a different build system and + * configuration. + */ +#include "psa/build_info.h" #include "psa/crypto.h" #include "psa/crypto_se_driver.h"