Skip to content

Commit 21c6c90

Browse files
committed
Make the storage configs dependent on the PSA label
This commit makes the storage configurations - setting MBEDTLS_PSA_CRYPTO_STORAGE_C, MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C and unsetting MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C - dependent on the PSA label being defined for the target. Previously these symbols were always defined for all platforms which could cause problems for targets that don't yet support PSA.
1 parent ca06f94 commit 21c6c90

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

features/mbedtls/importer/adjust-config.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,3 @@ conf unset MBEDTLS_PLATFORM_TIME_TYPE_MACRO
145145
# Reduce the maximal MBEDTLS_MPI_MAX_SIZE to 512 bytes,
146146
# which should fit RSA 4096 bit keys.
147147
conf set MBEDTLS_MPI_MAX_SIZE 512
148-
149-
# The following configurations are needed for Mbed Crypto.
150-
# They are related to the persistent key storage feature.
151-
conf set MBEDTLS_PSA_CRYPTO_STORAGE_C
152-
conf set MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
153-
conf unset MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C

features/mbedtls/platform/inc/platform_mbed.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@
4343
#include "mbedtls_device.h"
4444
#endif
4545

46+
#if defined(TARGET_PSA)
47+
/* The following configurations are a needed for Mbed Crypto submodule.
48+
* They are related to the persistent key storage feature.
49+
*/
50+
#define MBEDTLS_PSA_CRYPTO_STORAGE_C
51+
#define MBEDTLS_PSA_CRYPTO_STORAGE_ITS_C
52+
#undef MBEDTLS_PSA_CRYPTO_STORAGE_FILE_C
53+
#endif
54+
4655
/*
4756
* MBEDTLS_ERR_PLATFORM_HW_FAILED is deprecated and should not be used.
4857
*/

0 commit comments

Comments
 (0)