Skip to content

Commit 9e190f6

Browse files
valeriosettikartben
authored andcommitted
modules: uoscore-uedhoc: select required PSA Crypto features
Let uOSCORE and uEDHOC Kconfigs select required PSA Crypto features instead of having them selected in Mbed TLS' Kconfigs. Besides this the previous configuration was enabling legacy support in Mbed TLS whereas uOSCORE/uEDHOC use PSA Crypto APIs. Signed-off-by: Valerio Setti <[email protected]>
1 parent df34853 commit 9e190f6

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

modules/mbedtls/Kconfig.mbedtls

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,14 @@ comment "Supported key exchange modes"
4646

4747
config MBEDTLS_RSA_C
4848
bool "RSA base support"
49-
default y if UOSCORE || UEDHOC
5049

5150
if MBEDTLS_RSA_C
5251

5352
config MBEDTLS_PKCS1_V15
5453
bool "RSA PKCS1 v1.5"
55-
default y if UOSCORE || UEDHOC
5654

5755
config MBEDTLS_PKCS1_V21
5856
bool "RSA PKCS1 v2.1"
59-
default y if UOSCORE || UEDHOC
6057

6158
config MBEDTLS_GENPRIME_ENABLED
6259
bool "Prime number generation code"
@@ -172,7 +169,6 @@ config MBEDTLS_ECJPAKE_C
172169

173170
config MBEDTLS_ECP_C
174171
bool "Elliptic curve over GF(p) library"
175-
default y if UOSCORE || UEDHOC
176172

177173
if MBEDTLS_ECP_C
178174

@@ -204,7 +200,6 @@ config MBEDTLS_ECP_DP_SECP224R1_ENABLED
204200

205201
config MBEDTLS_ECP_DP_SECP256R1_ENABLED
206202
bool "SECP256R1 elliptic curve"
207-
default y if UOSCORE || UEDHOC
208203

209204
config MBEDTLS_ECP_DP_SECP384R1_ENABLED
210205
bool "SECP384R1 elliptic curve"
@@ -308,7 +303,6 @@ if MBEDTLS_SOME_AEAD_CIPHER_ENABLED
308303

309304
config MBEDTLS_CIPHER_CCM_ENABLED
310305
bool "Counter with CBC-MAC (CCM) mode for 128-bit block cipher"
311-
default y if UOSCORE || UEDHOC
312306

313307
config MBEDTLS_CIPHER_GCM_ENABLED
314308
bool "Galois/Counter Mode (GCM) for symmetric ciphers"
@@ -397,7 +391,6 @@ config MBEDTLS_CIPHER
397391

398392
config MBEDTLS_MD
399393
bool "generic message digest layer."
400-
default y if UOSCORE || UEDHOC
401394

402395
config MBEDTLS_ASN1_PARSE_C
403396
bool "Support for ASN1 parser functions"
@@ -593,7 +586,6 @@ config MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG_ALLOW_NON_CSPRNG
593586
config MBEDTLS_PSA_CRYPTO_C
594587
bool "Platform Security Architecture cryptography API"
595588
depends on !BUILD_WITH_TFM
596-
default y if UOSCORE || UEDHOC
597589

598590
config MBEDTLS_USE_PSA_CRYPTO
599591
bool "Use PSA APIs instead of legacy MbedTLS when possible"

modules/uoscore-uedhoc/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ menuconfig UOSCORE
66
depends on ZCBOR
77
depends on ZCBOR_CANONICAL
88
depends on MBEDTLS
9+
select UOSCORE_UEDHOC_CRYPTO_COMMON
10+
911
help
1012
This option enables the UOSCORE library.
1113

@@ -21,6 +23,7 @@ menuconfig UEDHOC
2123
depends on ZCBOR
2224
depends on ZCBOR_CANONICAL
2325
depends on MBEDTLS
26+
select UOSCORE_UEDHOC_CRYPTO_COMMON
2427
help
2528
This option enables the UEDHOC library.
2629

@@ -30,3 +33,23 @@ config UEDHOC_DEBUG
3033
bool "Debug logs in the uedhoc library"
3134

3235
endif # UEDHOC
36+
37+
if UOSCORE || UEDHOC
38+
39+
config UOSCORE_UEDHOC_CRYPTO_COMMON
40+
bool
41+
imply MBEDTLS_PSA_CRYPTO_C if !BUILD_WITH_TFM
42+
select PSA_WANT_ALG_ECDH
43+
select PSA_WANT_ALG_ECDSA
44+
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
45+
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
46+
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
47+
select PSA_WANT_KEY_TYPE_ECC_PUBLIC_KEY
48+
select PSA_WANT_ECC_SECP_R1_256
49+
select PSA_WANT_KEY_TYPE_AES
50+
select PSA_WANT_ALG_CCM
51+
select PSA_WANT_KEY_TYPE_HMAC
52+
select PSA_WANT_ALG_HMAC
53+
select PSA_WANT_ALG_SHA_256
54+
55+
endif # UOSCORE || UEDHOC

0 commit comments

Comments
 (0)