Skip to content

Conversation

@gabor-mezei-arm
Copy link
Contributor

@gabor-mezei-arm gabor-mezei-arm commented Apr 23, 2025

Description

Remove MBEDTLS_SHA3_C config option and replace it's references with PSA_WANT macros.

Depends on: Mbed-TLS/mbedtls#10201

PR checklist

Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.

@gabor-mezei-arm gabor-mezei-arm added enhancement New feature or request 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 priority-high High priority - will be reviewed soon needs-ci Needs to pass CI tests labels Apr 23, 2025
@gabor-mezei-arm gabor-mezei-arm self-assigned this Apr 23, 2025
@gabor-mezei-arm gabor-mezei-arm force-pushed the 9144_remove_sha3_config_option branch from 11a3634 to c87dffd Compare April 28, 2025 16:12
@gabor-mezei-arm gabor-mezei-arm removed the needs-ci Needs to pass CI tests label May 7, 2025
@gabor-mezei-arm gabor-mezei-arm force-pushed the 9144_remove_sha3_config_option branch from c87dffd to 2351aea Compare May 7, 2025 15:23
@gabor-mezei-arm gabor-mezei-arm moved this from In Development to In Review in Roadmap pull requests (new board) May 9, 2025
felixc-arm
felixc-arm previously approved these changes May 9, 2025
Copy link
Contributor

@felixc-arm felixc-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 👍

@mpg mpg requested a review from bjwtaylor May 12, 2025 07:48
@mpg mpg removed the needs-reviewer This PR needs someone to pick it up for review label May 12, 2025
@mpg
Copy link
Contributor

mpg commented May 12, 2025

@bjwtaylor Requesting a review from you since you're already reviewing the companion Mbed TLS PR.

@mpg
Copy link
Contributor

mpg commented May 12, 2025

@gabor-mezei-arm check-names seems unhappy

@gabor-mezei-arm
Copy link
Contributor Author

The deleted macro occurrence is located in the error.c which generation is handled in the mbedtls repo. So it is fixed there.

@gilles-peskine-arm
Copy link
Contributor

Merging a crypto PR that breaks the CI can be done, but it's a major hassle. Since the failure here is just in check_names, it shouldn't be too hard to make a backward-compatible transition. For example, add a temporary definition of MBEDTLS_SHA3_C, which can be removed in a future PR made after the mbedtls consumer has been merged.

@mpg
Copy link
Contributor

mpg commented May 13, 2025

Merging a crypto PR that breaks the CI can be done, but it's a major hassle.

100% agreed, let's try avoiding that.

Since the failure here is just in check_names, it shouldn't be too hard to make a backward-compatible transition. For example, add a temporary definition of MBEDTLS_SHA3_C, which can be removed in a future PR made after the mbedtls consumer has been merged.

IMO when we're removing something on the crypto side, the logical order is to remove users on the mbedtls side, then on the crypto side. From a quick look, it seems to me this should be doable here: first merge Mbed-TLS/mbedtls#10145 (without the submodule update), then merge this one, and be done with it.

I think this is a bit faster than what you were suggesting - which IIUC was (1) this PR with a dummy define, (2) 10145, (3) removing the dummy define, so 3 PRs total.

@mpg mpg requested review from mpg and removed request for bjwtaylor May 13, 2025 08:31
Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Looking pretty good to me, except for one change I don't understand. I'm sure you had a reason for doing it, but it's not apparent to me, and also the change doesn't look logical to me. So I'm holding my approval until this is clarified (and quite possibly if the change is correct and I'm just missing why, I'll request a comment explaining it, so we don't stumble again on it later).

@github-project-automation github-project-automation bot moved this from In Review to In Development in Roadmap pull requests (new board) May 14, 2025
@gabor-mezei-arm gabor-mezei-arm force-pushed the 9144_remove_sha3_config_option branch from 6f158c6 to 92d25c2 Compare May 19, 2025 16:17
mpg
mpg previously approved these changes May 20, 2025
Copy link
Contributor

@mpg mpg 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 - just need to fix the code style to make the CI fully happy.

@mpg mpg added the needs-work label May 20, 2025
@gabor-mezei-arm gabor-mezei-arm dismissed stale reviews from felixc-arm and mpg via 8dd1a90 May 29, 2025 14:22
Signed-off-by: Gabor Mezei <[email protected]>
Signed-off-by: Gabor Mezei <[email protected]>
Signed-off-by: Gabor Mezei <[email protected]>
`MBEDTLS_PSA_BUILTIN_ALG_SHA3_*` is the correct
replacement for the `MEBDTLS_SHA3_C` in SHA3 driver
related tests.

Signed-off-by: Gabor Mezei <[email protected]>
Signed-off-by: Gabor Mezei <[email protected]>
To manage the merge of the crypto repo changes let the
mbedtls repo to use the legacy macros definition.

Signed-off-by: Gabor Mezei <[email protected]>
Signed-off-by: Gabor Mezei <[email protected]>
@gabor-mezei-arm gabor-mezei-arm force-pushed the 9144_remove_sha3_config_option branch from 8dd1a90 to fc443ba Compare May 30, 2025 08:17
@gabor-mezei-arm
Copy link
Contributor Author

I'm inclined to just add 4 temporary all.sh components in components-configuration.sh that each build with full minus PSA_WANT_ALG_SHA3_xxx for the 4 possible values of xxx. Then this PR should be mergeable on its own, then we can merge the mbedtls PR then the depends.py PR then remove the temporary components and other temporary hacks.

Adding a new component is not working because in the CI the analyze_outcome runs separately for the TLS and PSA repo tests. So test results from PSA repo will not take into account when analyzing the TLS repo and it will fail.

@gilles-peskine-arm
Copy link
Contributor

I think we need to merge the new test component in the mbedtls repository first.

(And until we disentangle configuration coverage testing somehow, the mbedtls repository needs to do complete testing of crypto configurations, even if they don't impact X.509 or TLS.)

@gabor-mezei-arm
Copy link
Contributor Author

I think we need to merge the new test component in the mbedtls repository first.

Done in Mbed-TLS/mbedtls#10201

Copy link
Contributor

@felixc-arm felixc-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 now that the CI is green 🙂

@mpg mpg removed needs-work needs-ci Needs to pass CI tests labels Jun 3, 2025
Copy link
Contributor

@mpg mpg 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!

@mpg mpg added this pull request to the merge queue Jun 3, 2025
@mpg mpg added the approved Design and code approved - may be waiting for CI or backports label Jun 3, 2025
Merged via the queue into Mbed-TLS:development with commit d056817 Jun 3, 2025
3 checks passed
@github-project-automation github-project-automation bot moved this from Has Approval to Done in Roadmap pull requests (new board) Jun 3, 2025
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 enhancement New feature or request priority-high High priority - will be reviewed soon

Development

Successfully merging this pull request may close these issues.

4 participants