Skip to content
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

Resolve to run the legacy only test cases with PSA_WANT macros #9251

Conversation

gabor-mezei-arm
Copy link
Contributor

@gabor-mezei-arm gabor-mezei-arm commented Jun 13, 2024

Description

In all.sh update the test_full_no_cipher_no_psa_crypto test component and update config-no-entropy.h config with crypto config.
With replacing the MD_CAN macros with PSA_WANT counterparts the pure legacy test cases in test_suite_md.psa are need to update the config options from crypto_config.h.

PR checklist

Please tick as appropriate and edit the reasons (e.g.: "backport: not needed because this is a new feature")

  • changelog not required, test related changes
  • 3.6 backport not required, needed for 4.0
  • 2.28 backport not required, needed for 4.0
  • tests not required, test related changes

With replacing the `MD_CAN` macros with `PSA_WANT` counterparts
the pure legacy test cases are needing the config options
from `crypto_config.h`.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
@gabor-mezei-arm gabor-mezei-arm added enhancement needs-ci Needs to pass CI tests component-test Test framework and CI scripts priority-very-high Highest priority - prioritise this over other review work size-xs Estimated task size: extra small (a few hours at most) labels Jun 13, 2024
@gabor-mezei-arm gabor-mezei-arm self-assigned this Jun 13, 2024
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
@gabor-mezei-arm gabor-mezei-arm added needs-review Every commit must be reviewed by at least two team members, needs-reviewer This PR needs someone to pick it up for review and removed needs-ci Needs to pass CI tests labels Jun 14, 2024
@@ -1711,20 +1711,32 @@ component_test_crypto_full_md_light_only () {
make test
}

component_test_full_no_cipher_no_psa_crypto () {
component_test_full_no_cipher_with_legacy () {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In #9185 I just remove this component as it is not relevant anymore in 4.0 context.

@@ -17,6 +17,9 @@
* See README.txt for usage instructions.
*/

#define MBEDTLS_PSA_CRYPTO_CONFIG_FILE "../configs/crypto-config-no-entropy.h"
#define MBEDTLS_PSA_CRYPTO_CONFIG
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we have done for other configuration files you need to enable MBEDTLS_PSA_CRYPTO_C and
MBEDTLS_USE_PSA_CRYPTO which requires MBEDTLS_ENTROPY_C defeating the purpose of this configuration. I think we have some plans to be able to initialize and use only PSA APIs that do not rely on some entropy but in the mean time not sure what we should do with this configuration. @gilles-peskine-arm what do you think?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have a PSA-based configuration without entropy.c by using MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG, which is a simulated entropy source (encapsulated in a simulated RNG). But we already have components with that option, and it's not the goal here. The goal here is to enable the parts of the library that don't require entropy.

In the future, we'll have a way to make PSA crypto work without a RNG, which will allow to do the same things that config-no-entropy.h currently does (hash, MAC, symmetric ciphers, KDF, signature verification, X.509 verification). But that requires work on splitting psa_crypto_init, and we haven't done that work yet (we were thinking of doing it in Q3, but I suspect it'll get delayed to Q4 so we can focus on the repo split).

For now, we can either keep config-no-entropy.h as is, or remove it but file an issue to re-create it when we can, i.e. as part of the split-init epic. I think re-creating it later is the way to go, because keeping legacy config options for some time would hurt other work.

Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments

This reverts commit df59c63.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
This reverts commit 5bc887c.

Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
Signed-off-by: Gabor Mezei <gabor.mezei@arm.com>
@gabor-mezei-arm gabor-mezei-arm force-pushed the update_test_full_no_cipher_no_psa_crypto branch from 2102d29 to 1b646c2 Compare June 18, 2024 15:37
Copy link
Contributor

@ronald-cron-arm ronald-cron-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have #9284 to not forget about adding back an equivalent configuration when the PSA implementation is ready for that thus I am happy with this change, thanks.

@tom-daubney-arm tom-daubney-arm self-requested a review June 19, 2024 15:57
@tom-daubney-arm tom-daubney-arm removed the needs-reviewer This PR needs someone to pick it up for review label Jun 19, 2024
Copy link
Contributor

@tom-daubney-arm tom-daubney-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks!

@tom-daubney-arm tom-daubney-arm added approved Design and code approved - may be waiting for CI or backports and removed needs-review Every commit must be reviewed by at least two team members, labels Jun 20, 2024
@mpg mpg added this pull request to the merge queue Jun 20, 2024
Merged via the queue into Mbed-TLS:development with commit 2a674bd Jun 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Design and code approved - may be waiting for CI or backports component-test Test framework and CI scripts enhancement priority-very-high Highest priority - prioritise this over other review work size-xs Estimated task size: extra small (a few hours at most)
Projects
Status: Remove legacy symbols
Development

Successfully merging this pull request may close these issues.

5 participants