-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
base: main
Are you sure you want to change the base?
mbedtls: add a new Kconfig file for PSA_WANT logic #78531
Conversation
ade8e9e
to
eb033cc
Compare
modules/mbedtls/Kconfig.psa.logic
Outdated
EC-JPAKE. | ||
|
||
# All the following logical constraints are taken from the PSA API documentation: | ||
# https://arm-software.github.io/psa-api/crypto/1.1/index.html |
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.
Which section exactly?
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.
It could've been good to keep this reference, but just to make it more precise if possible.
modules/mbedtls/Kconfig.psa.logic
Outdated
|
||
# Mbed TLS does some assumption on asymmetric keys' build symbols | ||
# (see modules/crypto/mbedtls/include/psa/crypto_adjust_config_key_pair_types.h): | ||
# - PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_BASIC is automatically set whenever one of |
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.
# - PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_BASIC is automatically set whenever one of | |
# - that PSA_WANT_KEY_TYPE_xxx_KEY_PAIR_BASIC is set whenever one of |
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.
automatically
is still there but could be removed IMO.
eb033cc
to
8406c3d
Compare
The already existing "Kconfig.psa" maps Mbed TLS's PSA_WANT_xxx symbols to Kconfigs that can be used in Zephyr to select which PSA crypto API feature should be enabled in the build. In order to ease maintainability, "Kconfig.psa" is automatically generated so it should not be edited manually to add logic between Kconfigs symbols defined there. As a consequence a new Kconfig file is introduced in this commit, named "Kconfig.psa.logic", to address this limitation. This new Kconfig file does not add new public symbols (only hidden ones, if needed) and it simply adds logic between PSA_WANT ones. This commit also renames "Kconfig.psa" as "Kconfig.psa.auto" to put it at the same "naming level" as the newly created file and, at the same time, emphasize that it is an automatically generated file. Signed-off-by: Valerio Setti <[email protected]>
8406c3d
to
2c167ed
Compare
# Copyright (c) 2024 BayLibre SAS | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# This file extends Kconfig.psa (which is automatically generated) by adding |
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.
# This file extends Kconfig.psa (which is automatically generated) by adding | |
# This file extends Kconfig.psa.auto (which is automatically generated) by adding |
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
# 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 comment
The reason will be displayed to describe this comment to others. Learn more.
# some logic between PSA_WANT symbols. | |
# some logic around PSA_WANT symbols. |
modules/mbedtls/Kconfig.psa.logic
Outdated
EC-JPAKE. | ||
|
||
# All the following logical constraints are taken from the PSA API documentation: | ||
# https://arm-software.github.io/psa-api/crypto/1.1/index.html |
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.
It could've been good to keep this reference, but just to make it more precise if possible.
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.
Almost there!
# Dependencies between KDF (key derivation function) algorithms and low-level | ||
# crypto ones. |
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.
If you are making such a comment, then it would make sense to properly cover all the sections. Because I think that this section stops at PSA_WANT_ALG_TLS12_PRF
?
(Or just keep the old comment, IMO it was good, with a reference to the PSA Crypto spec.)
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you remove all the depends on PSA_WANT_KEY_TYPE_*
in here?
The already existing
Kconfig.psa
maps Mbed TLS's PSA_WANT_xxx symbols to Kconfigs that can be used in Zephyr to select which PSA crypto API feature should be enabled in the build. In order to ease maintainability,Kconfig.psa
is automatically generated so it should not be edited manually to add logic between Kconfigs symbols defined there. As a consequence a new Kconfig file is introduced in this PR, namedKconfig.psa.logic
, to address this limitation. This new Kconfig file does not add new public symbols (only hidden ones, if needed) and it simply adds logic between PSA_WANT ones.This commit also updates the pyhton script
create_psa_files.py
in order to adapt it to the changes done inKconfig.psa
.