Skip to content

Commit

Permalink
samples: Change PSA WANT ECC key pair
Browse files Browse the repository at this point in the history
Adapt to the new configurations from the
Oberon PSA core.

Signed-off-by: Georgios Vasilakis <georgios.vasilakis@nordicsemi.no>
  • Loading branch information
Vge0rge authored and nordicjm committed Apr 18, 2024
1 parent 9bf8147 commit e51875c
Show file tree
Hide file tree
Showing 15 changed files with 42 additions and 15 deletions.
2 changes: 1 addition & 1 deletion applications/serial_lte_modem/overlay-native_tls.conf
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_PSA_WANT_ALG_ECDSA=y
CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y
CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y # dep for DETERMINISTIC_ECDSA
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y # dep for DETERMINISTIC_ECDSA
CONFIG_PSA_WANT_ALG_HMAC=y # dep for DETERMINISTIC_ECDSA
# Enable ECDH
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED=y
Expand Down
3 changes: 2 additions & 1 deletion lib/identity_key/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ if IDENTITY_KEY

config IDENTITY_KEY_RANDOM
bool "Enable writing random Identity Keys"
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
select PSA_WANT_ECC_SECP_R1_256
help
Enable the identity_key_write_random() function.
Expand Down
4 changes: 3 additions & 1 deletion modules/hostap/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ config WPA_SUPP_CRYPTO_PSA
select PSA_WANT_GENERATE_RANDOM
select PSA_WANT_ALG_RSA_PSS
select PSA_WANT_ALG_DETERMINISTIC_ECDSA
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR # dep for DETERMINISTIC_ECDSA
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE # ECC_KEY_PAIR* deps for DETERMINISTIC_ECDSA
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
select PSA_WANT_ALG_SHA_512
select PSA_WANT_ALG_SHA_1
select PSA_WANT_KEY_TYPE_RSA_KEY_PAIR
Expand Down
3 changes: 2 additions & 1 deletion modules/trusted-firmware-m/Kconfig.tfm.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ config TFM_PARTITION_INITIAL_ATTESTATION
# The identity key is a secp256r1 key pair.
# The ECDSA algorithm and the cc3xx boot seed requires RNG.
select PSA_WANT_ALG_SHA_256
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
select PSA_WANT_ALG_ECDSA
select PSA_WANT_ECC_SECP_R1_256
select PSA_WANT_GENERATE_RANDOM
Expand Down
4 changes: 3 additions & 1 deletion samples/crypto/ecdh/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192

CONFIG_PSA_WANT_ALG_ECDH=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_ECC_SECP_R1_256=y

# For key generation
Expand Down
4 changes: 3 additions & 1 deletion samples/crypto/ecdsa/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192

CONFIG_PSA_WANT_ALG_ECDSA=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_ECC_SECP_R1_256=y
CONFIG_PSA_WANT_ALG_SHA_256=y

Expand Down
4 changes: 3 additions & 1 deletion samples/crypto/eddsa/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ CONFIG_MBEDTLS_PSA_CRYPTO_C=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=8192

CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_ECC_TWISTED_EDWARDS_255=y
CONFIG_PSA_WANT_ALG_SHA_512=y
CONFIG_PSA_WANT_ALG_PURE_EDDSA=y
Expand Down
5 changes: 4 additions & 1 deletion samples/crypto/psa_tls/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ CONFIG_PSA_WANT_ALG_ECDH=y
CONFIG_PSA_WANT_ALG_ECDSA=y
CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA=y
CONFIG_PSA_WANT_ECC_SECP_R1_256=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_ALG_STREAM_CIPHER=y
CONFIG_PSA_WANT_KEY_TYPE_CHACHA20=y
CONFIG_PSA_WANT_ALG_TLS12_PSK_TO_MS=y
Expand Down
2 changes: 1 addition & 1 deletion samples/keys/identity_key_usage/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ CONFIG_LOG_BACKEND_UART=y
CONFIG_LOG_BUFFER_SIZE=15360
CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=15360

CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
2 changes: 1 addition & 1 deletion samples/net/http_server/overlay-tls-nrf91.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ CONFIG_PSA_WANT_ALG_ECDSA=y
CONFIG_MBEDTLS_ECDSA_DETERMINISTIC=y
CONFIG_PSA_WANT_ALG_DETERMINISTIC_ECDSA=y
CONFIG_PSA_WANT_ALG_HMAC=y # dependency for DETERMINISTIC_ECDSA
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y # dependency for DETERMINISTIC_ECDSA
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y # dependency for DETERMINISTIC_ECDSA

# Enable ECDH
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED=y
Expand Down
4 changes: 3 additions & 1 deletion subsys/bluetooth/mesh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ config BT_MESH_USES_TFM_PSA
select PSA_WANT_ALG_HMAC
select PSA_WANT_ALG_ECDH
select PSA_WANT_ECC_SECP_R1_256
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT

choice TFM_PROFILE_TYPE
depends on BT_MESH_USES_TFM_PSA
Expand Down
5 changes: 4 additions & 1 deletion subsys/net/openthread/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ config OPENTHREAD_NRF_SECURITY_PSA
select PSA_WANT_ECC_SECP_R1_256
select PSA_WANT_GENERATE_RANDOM
select PSA_WANT_KEY_TYPE_AES
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE
imply OPENTHREAD_CRYPTO_PSA
help
Enables nrf_security module for use by OpenThread with PSA Crypto enabled.
Expand Down
5 changes: 4 additions & 1 deletion subsys/nrf_security/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ config MBEDTLS_KEY_EXCHANGE_SOME_PSK_ENABLED

config MBEDTLS_ECP_ALL_ENABLED
bool "Enable all available elliptic curves"
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT
select PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE
select PSA_WANT_ECC_SECP_R1_192
select PSA_WANT_ECC_SECP_R1_224
select PSA_WANT_ECC_SECP_R1_256
Expand Down
5 changes: 4 additions & 1 deletion tests/tfm/tfm_psa_test/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ CONFIG_PSA_WANT_GENERATE_RANDOM=y
# Keys
CONFIG_PSA_WANT_KEY_TYPE_AES=y
CONFIG_PSA_WANT_KEY_TYPE_CHACHA20=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR=y

# Ciphers
Expand Down
5 changes: 4 additions & 1 deletion tests/tfm/tfm_regression_test/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ CONFIG_PSA_WANT_GENERATE_RANDOM=y

# Keys
CONFIG_PSA_WANT_KEY_TYPE_AES=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_IMPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_EXPORT=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_DERIVE=y
CONFIG_PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_GENERATE=y
CONFIG_PSA_WANT_KEY_TYPE_RSA_KEY_PAIR=y

# Ciphers
Expand Down

0 comments on commit e51875c

Please sign in to comment.