Skip to content

Commit

Permalink
[nrf noup] Include PSA config file in TF-M PSA interface header
Browse files Browse the repository at this point in the history
Include the PSA config file in TF_M PSA interface header.

This is a noup commit because it is and adapted change based on upstream
commit that contains other changes that would cause merge conflicts.
An additional PR was made to upstream to improve the way the config
header is included.

Upstream commit:
34a0ffd
Upstream PR:
https://review.trustedfirmware.org/c/TF-M/trusted-firmware-m/+/21759

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
  • Loading branch information
joerchan authored and nordicjm committed Jul 6, 2023
1 parent 353e621 commit 86fdfb9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
11 changes: 11 additions & 0 deletions interface/include/psa/crypto.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
#ifndef PSA_CRYPTO_H
#define PSA_CRYPTO_H

/* In Mbed TLS, we would query the current config through inclusion of
* of mbedtls/build_info.h, but in TF-M, we don't rely on build_info.h
* hence we just include the current configuration if it has been passed
* through command line. These config defines are required in crypto_sizes.h
* to compute macros that define sizes which depend on algorithms supported
* by the implementation
*/
#if defined(MBEDTLS_PSA_CRYPTO_CONFIG_FILE)
#include MBEDTLS_PSA_CRYPTO_CONFIG_FILE
#endif /* MBEDTLS_PSA_CRYPTO_CONFIG_FILE */

#include <stddef.h>

#ifdef __DOXYGEN_ONLY__
Expand Down
5 changes: 0 additions & 5 deletions interface/include/psa/crypto_sizes.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,6 @@
/* The maximum size of an ECC key on this implementation, in bits.
* This is a vendor-specific macro. */
#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
#if defined(MBEDTLS_PSA_CRYPTO_CONFIG_FILE)
#include MBEDTLS_PSA_CRYPTO_CONFIG_FILE
#else
#include "psa/crypto_config.h"
#endif
#if defined(PSA_WANT_ECC_SECP_R1_521)
#define PSA_VENDOR_ECC_MAX_CURVE_BITS 521
#elif defined(PSA_WANT_ECC_BRAINPOOL_P_R1_512)
Expand Down

0 comments on commit 86fdfb9

Please sign in to comment.