Skip to content

Commit 0609e5f

Browse files
tomi-fontjfischer-no
authored andcommitted
[nrf fromlist] modules: mbedtls: make key exchange Kconfigs depend on, not select
Turn the MBEDTLS_RSA_FULL selects into depends on. This is how the other MBEDTLS_KEY_EXCHANGE_* Kconfig options are defined. This is done to avoid circular dependencies. Upstream PR #: 89200 Signed-off-by: Tomi Fontanilles <[email protected]> (cherry picked from commit c97368cde558f105b1e7a5652053b4cbddf919cb)
1 parent b9c69d1 commit 0609e5f

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

modules/mbedtls/Kconfig.mbedtls

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ config MBEDTLS_GENPRIME_ENABLED
6565
endif # MBEDTLS_RSA_C
6666

6767
config MBEDTLS_RSA_FULL
68-
bool
69-
select MBEDTLS_RSA_C
70-
select MBEDTLS_PKCS1_V15
71-
select MBEDTLS_PKCS1_V21
68+
def_bool y
69+
depends on MBEDTLS_RSA_C && MBEDTLS_PKCS1_V15 && MBEDTLS_PKCS1_V21
7270

7371
if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)
7472

@@ -98,7 +96,7 @@ config MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED
9896

9997
config MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED
10098
bool "RSA-PSK based ciphersuite modes"
101-
select MBEDTLS_RSA_FULL
99+
depends on MBEDTLS_RSA_FULL
102100

103101
endif # !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)
104102

@@ -114,8 +112,8 @@ if !(NRF_SECURITY || NORDIC_SECURITY_BACKEND)
114112
config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
115113
bool "RSA-only based ciphersuite modes"
116114
default y if UOSCORE || UEDHOC
117-
select MBEDTLS_MD
118-
select MBEDTLS_RSA_FULL
115+
depends on MBEDTLS_MD
116+
depends on MBEDTLS_RSA_FULL
119117
select PSA_WANT_KEY_TYPE_RSA_PUBLIC_KEY if PSA_CRYPTO_CLIENT
120118
select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_IMPORT if PSA_CRYPTO_CLIENT
121119
select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT if PSA_CRYPTO_CLIENT
@@ -124,11 +122,11 @@ config MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
124122

125123
config MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED
126124
bool "DHE-RSA based ciphersuite modes"
127-
select MBEDTLS_RSA_FULL
125+
depends on MBEDTLS_RSA_FULL
128126

129127
config MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
130128
bool "ECDHE-RSA based ciphersuite modes"
131-
select MBEDTLS_RSA_FULL
129+
depends on MBEDTLS_RSA_FULL
132130
depends on MBEDTLS_ECDH_C
133131

134132
config MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
@@ -272,15 +270,13 @@ config MBEDTLS_CIPHER_ALL_ENABLED
272270
select MBEDTLS_CHACHAPOLY_AEAD_ENABLED
273271

274272
config MBEDTLS_SOME_AEAD_CIPHER_ENABLED
275-
bool
276-
default y
273+
def_bool y
277274
depends on \
278275
MBEDTLS_CIPHER_AES_ENABLED || \
279276
MBEDTLS_CIPHER_CAMELLIA_ENABLED
280277

281278
config MBEDTLS_SOME_CIPHER_ENABLED
282-
bool
283-
default y
279+
def_bool y
284280
depends on \
285281
MBEDTLS_SOME_AEAD_CIPHER_ENABLED || \
286282
MBEDTLS_CIPHER_DES_ENABLED || \
@@ -634,8 +630,7 @@ config MBEDTLS_USE_PSA_CRYPTO
634630
"intermediate" modules such as PK, MD and Cipher.
635631

636632
config MBEDTLS_PSA_CRYPTO_CLIENT
637-
bool
638-
default y
633+
def_bool y
639634
depends on BUILD_WITH_TFM || MBEDTLS_PSA_CRYPTO_C
640635
select PSA_CRYPTO_CLIENT
641636

0 commit comments

Comments
 (0)