Skip to content

Commit

Permalink
samples: tfm_integration: psa_crypto: improve the MbedTLS configuration
Browse files Browse the repository at this point in the history
Move supported configuration items from the custom MbedTLS user
configuration file over to the Kconfig overlay.
The correct macros are then defined by the MbedTLS module according
to the values of the Kconfig options.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
  • Loading branch information
tomi-font committed May 3, 2024
1 parent bd228a2 commit cb3ffae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 14 deletions.
6 changes: 6 additions & 0 deletions samples/tfm_integration/psa_crypto/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ CONFIG_MBEDTLS_HEAP_SIZE=32768
CONFIG_MBEDTLS_USER_CONFIG_ENABLE=y
CONFIG_MBEDTLS_USER_CONFIG_FILE="user-tls-conf.h"

CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENTROPY_ENABLED=y
CONFIG_MBEDTLS_ECP_C=y
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
CONFIG_MBEDTLS_ECDSA_C=y

# JSON
CONFIG_JSON_LIBRARY=y

Expand Down
14 changes: 0 additions & 14 deletions samples/tfm_integration/psa_crypto/src/tls_config/user-tls-conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

#define MBEDTLS_USE_PSA_CRYPTO
#define MBEDTLS_PSA_CRYPTO_C

#define MBEDTLS_ENTROPY_C
#define MBEDTLS_TEST_NULL_ENTROPY

#define MBEDTLS_ECP_C
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECDSA_C

#define MBEDTLS_X509_CSR_WRITE_C
#define MBEDTLS_X509_CREATE_C
#define MBEDTLS_PEM_WRITE_C
#define MBEDTLS_BASE64_C
#define MBEDTLS_OID_C
#define MBEDTLS_ASN1_WRITE_C
#define MBEDTLS_PK_WRITE_C
#define MBEDTLS_PK_C

0 comments on commit cb3ffae

Please sign in to comment.