Skip to content

Commit

Permalink
[nrf noup] mbedtls: Add dependency logic for PSA crypto configurations
Browse files Browse the repository at this point in the history
-This is a [nrf noup] as this the upstream version of PSA crypto configs
 is generated by tooling, and there is no mechanisms to qualify
 that dependent configurations are enabled (by depends or select).
-This adds dependency-mapping between configurations in the Kconfigs
 added for PSA crypto in upstream.

Signed-off-by: Frank Audun Kvamtrø <[email protected]>
  • Loading branch information
frkv authored and bjarki-andreasen committed Sep 19, 2024
1 parent 46e254f commit 47a1e03
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions modules/mbedtls/Kconfig.psa
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ config PSA_WANT_ALG_GCM
config PSA_WANT_ALG_HKDF
bool "PSA_WANT_ALG_HKDF" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_ALG_HMAC

config PSA_WANT_ALG_HKDF_EXTRACT
bool "PSA_WANT_ALG_HKDF_EXTRACT" if !MBEDTLS_PROMPTLESS
Expand All @@ -92,11 +93,12 @@ config PSA_WANT_ALG_MD5
config PSA_WANT_ALG_PBKDF2_HMAC
bool "PSA_WANT_ALG_PBKDF2_HMAC" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_ALG_HMAC

config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128
bool "PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL

depends on PSA_WANT_ALG_CMAC

config PSA_WANT_ALG_RSA_OAEP
bool "PSA_WANT_ALG_RSA_OAEP" if !MBEDTLS_PROMPTLESS
Expand Down Expand Up @@ -157,14 +159,17 @@ config PSA_WANT_ALG_STREAM_CIPHER
config PSA_WANT_ALG_TLS12_PRF
bool "PSA_WANT_ALG_TLS12_PRF" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_ALG_HMAC

config PSA_WANT_ALG_TLS12_PSK_TO_MS
bool "PSA_WANT_ALG_TLS12_PSK_TO_MS" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_ALG_HMAC

config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS
bool "PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_ALG_SHA_256

config PSA_WANT_ECC_BRAINPOOL_P_R1_256
bool "PSA_WANT_ECC_BRAINPOOL_P_R1_256" if !MBEDTLS_PROMPTLESS
Expand Down Expand Up @@ -237,7 +242,8 @@ config PSA_WANT_KEY_TYPE_AES
config PSA_WANT_KEY_TYPE_CHACHA20
bool "PSA_WANT_KEY_TYPE_CHACHA20" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL

depends on PSA_WANT_ALG_CHACHA20_POLY1305 || \
PSA_WANT_ALG_STREAM_CIPHER

config PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY
bool "PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY" if !MBEDTLS_PROMPTLESS
Expand All @@ -254,37 +260,53 @@ config PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY
config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC
bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT || \
PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT || \
PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE || \
PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE

config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL

config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL

config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL

config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE
bool "PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL

config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC
bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC" if !MBEDTLS_PROMPTLESS
default y if PSA_CRYPTO_ENABLE_ALL
depends on PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT || \
PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT || \
PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE || \
PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_DERIVE

config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT
bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL

config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT
bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL

config PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE
bool "PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" if !MBEDTLS_PROMPTLESS
select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY
default y if PSA_CRYPTO_ENABLE_ALL
default y if PSA_CRYPTO_ENABLE_ALL

endif # PSA_CRYPTO_CLIENT

0 comments on commit 47a1e03

Please sign in to comment.