mbedtls: add new PSA_CRYPTO_CLIENT config

Using MBEDTLS_PSA_CRYPTO_CLIENT to guard all PSA_WANT symbols is
not completely correct because:

1. the prefix MBEDTLS suggests that it's something related to
   MbedTLS, while actually PSA APIs can be provided also
   by other implementations (ex: TFM)

2. there might applications which are willing to use PSA APIs
   without using MbedTLS at all. For example computing an hash
   can be as simple as writing psa_hash_compute() and, if the
   PSA function is provided thorugh TFM, then MbedTLS is not
   required at all

Therefore this commit:

- moves MBEDTLS_PSA_CRYPTO_CLIENT to Kconfig.tls-generic since
  that symbol belongs to MbedTLS

- adds a new symbol named PSA_CRYPTO_CLIENT as a generic way
  to state that there is "some" PSA crypto API provider

- let MBEDTLS_PSA_CRYPTO_CLIENT automatically select
  PSA_CRYPTO_CLIENT, since the former is an implementation of
  the latter.

Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This commit is contained in:
Valerio Setti 2024-05-13 14:35:37 +02:00 committed by Anas Nashif
commit 12ff947568
4 changed files with 19 additions and 10 deletions

View file

@ -33,6 +33,7 @@ menuconfig BUILD_WITH_TFM
imply INIT_ARCH_HW_AT_BOOT
imply ARM_NONSECURE_PREEMPTIBLE_SECURE_CALLS
imply MBEDTLS
imply PSA_CRYPTO_ENABLE_ALL
help
When enabled, this option instructs the Zephyr build process to
additionally generate a TF-M image for the Secure Execution