-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mbedtls: add a new Kconfig file for PSA_WANT logic #78531
Open
valeriosetti
wants to merge
1
commit into
zephyrproject-rtos:main
Choose a base branch
from
valeriosetti:psa-depedency-logic
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+109
−5
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,6 +4,12 @@ | |||||
# This file extends Kconfig.psa (which is automatically generated) by adding | ||||||
# some logic between PSA_WANT symbols. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
# PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_BASIC build symbols are automatically | ||||||
# enabled in Mbed TLS header files whenever any key pair feature between | ||||||
# IMPORT,EXPORT, GENERATE,DERIVE is set | ||||||
# (see modules/crypto/mbedtls/include/psa/crypto_adjust_config_key_pair_types.h). | ||||||
# We mimic the same behavior with Kconfigs. | ||||||
|
||||||
config PSA_WANT_KEY_TYPE_ECC_KEY_PAIR_BASIC | ||||||
bool | ||||||
default y | ||||||
|
@@ -25,3 +31,99 @@ config PSA_WANT_KEY_TYPE_DH_KEY_PAIR_BASIC | |||||
depends on PSA_WANT_KEY_TYPE_DH_KEY_PAIR_IMPORT || \ | ||||||
PSA_WANT_KEY_TYPE_DH_KEY_PAIR_EXPORT || \ | ||||||
PSA_WANT_KEY_TYPE_DH_KEY_PAIR_GENERATE | ||||||
|
||||||
# Internal symbols that can be used to check whether there is some kind of | ||||||
# support in the PSA Crypto API. | ||||||
|
||||||
config PSA_CAN_SOME_HASH | ||||||
bool | ||||||
default y if (PSA_WANT_ALG_MD5 || \ | ||||||
PSA_WANT_ALG_SHA_1 || \ | ||||||
PSA_WANT_ALG_SHA_224 || \ | ||||||
PSA_WANT_ALG_SHA_256 || \ | ||||||
PSA_WANT_ALG_SHA_384 || \ | ||||||
PSA_WANT_ALG_SHA_512 || \ | ||||||
PSA_WANT_ALG_SHA3_224 || \ | ||||||
PSA_WANT_ALG_SHA3_256 || \ | ||||||
PSA_WANT_ALG_SHA3_384 || \ | ||||||
PSA_WANT_ALG_SHA3_512) | ||||||
help | ||||||
Promptless symbol that can be used to check if there's some type of hash | ||||||
support enabled (no matter which algorithm) in the PSA Crypto API. | ||||||
|
||||||
config PSA_CAN_SOME_ECC | ||||||
bool | ||||||
default y if (PSA_WANT_ECC_BRAINPOOL_P_R1_256 || \ | ||||||
PSA_WANT_ECC_BRAINPOOL_P_R1_384 || \ | ||||||
PSA_WANT_ECC_BRAINPOOL_P_R1_512 || \ | ||||||
PSA_WANT_ECC_MONTGOMERY_255 || \ | ||||||
PSA_WANT_ECC_MONTGOMERY_448 || \ | ||||||
PSA_WANT_ECC_SECP_K1_192 || \ | ||||||
PSA_WANT_ECC_SECP_K1_256 || \ | ||||||
PSA_WANT_ECC_SECP_R1_192 || \ | ||||||
PSA_WANT_ECC_SECP_R1_224 || \ | ||||||
PSA_WANT_ECC_SECP_R1_256 || \ | ||||||
PSA_WANT_ECC_SECP_R1_384 || \ | ||||||
PSA_WANT_ECC_SECP_R1_521) | ||||||
help | ||||||
Promptless symbol that can be used to check if there's at least one family | ||||||
of elliptic curve enabled in the PSA Crypto API. | ||||||
|
||||||
config PSA_CAN_ECDSA | ||||||
bool | ||||||
default y if (PSA_WANT_ALG_ECDSA || PSA_WANT_ALG_DETERMINISTIC_ECDSA) && \ | ||||||
PSA_CAN_SOME_ECC | ||||||
help | ||||||
Promptless symbol that can be used to check if the PSA Crypto API support | ||||||
ECDSA (either deterministic or not) for at least one curve family. | ||||||
|
||||||
config PSA_CAN_ECDH | ||||||
bool | ||||||
default y if PSA_WANT_ALG_ECDH && PSA_CAN_SOME_ECC | ||||||
help | ||||||
Promptless symbol that can be used to check if the PSA Crypto API support | ||||||
ECDH for at least one curve family. | ||||||
|
||||||
config PSA_CAN_ECJPAKE | ||||||
bool | ||||||
default y if PSA_WANT_ECC_SECP_R1_256 && PSA_WANT_ALG_SHA_256 | ||||||
help | ||||||
Promptless symbol that can be used to check if the PSA Crypto API support | ||||||
EC-JPAKE. | ||||||
|
||||||
# Dependencies for KDF (key derivation function) algorithms. | ||||||
|
||||||
config PSA_WANT_ALG_HKDF | ||||||
depends on PSA_WANT_KEY_TYPE_HMAC | ||||||
depends on PSA_WANT_ALG_HMAC | ||||||
depends on PSA_CAN_SOME_HASH | ||||||
|
||||||
config PSA_WANT_ALG_HKDF_EXTRACT | ||||||
depends on PSA_WANT_ALG_HKDF | ||||||
|
||||||
config PSA_WANT_ALG_HKDF_EXPAND | ||||||
depends on PSA_WANT_ALG_HKDF | ||||||
|
||||||
config PSA_WANT_ALG_PBKDF2_HMAC | ||||||
depends on PSA_WANT_KEY_TYPE_HMAC | ||||||
depends on PSA_WANT_ALG_HMAC | ||||||
depends on PSA_CAN_SOME_HASH | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you remove all the |
||||||
|
||||||
config PSA_WANT_ALG_PBKDF2_AES_CMAC_PRF_128 | ||||||
depends on PSA_WANT_KEY_TYPE_AES | ||||||
depends on PSA_WANT_ALG_CMAC | ||||||
|
||||||
config PSA_WANT_ALG_TLS12_PRF | ||||||
depends on PSA_WANT_KEY_TYPE_HMAC | ||||||
depends on PSA_WANT_ALG_HMAC | ||||||
depends on (PSA_WANT_ALG_SHA_256 || \ | ||||||
PSA_WANT_ALG_SHA_384) | ||||||
|
||||||
config PSA_WANT_ALG_TLS12_PSK_TO_MS | ||||||
depends on PSA_WANT_KEY_TYPE_HMAC | ||||||
depends on PSA_WANT_ALG_HMAC | ||||||
depends on (PSA_WANT_ALG_SHA_256 || \ | ||||||
PSA_WANT_ALG_SHA_384) | ||||||
|
||||||
config PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS | ||||||
depends on PSA_WANT_ALG_SHA_256 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.