[tf-psa-crypto] md: allow dispatch to PSA whenever CRYPTO_CLIENT is enabled#188
Merged
mpg merged 7 commits intoMbed-TLS:developmentfrom Mar 4, 2025
Merged
Conversation
Move the auto-enabling of CRYPTO_CLIENT when CRYPTO_C at the beginning of the file so that all that becomes later is aware of this. Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Instead of allowing PSA dispatching only when CRYPTO_C is set and some MBEDTLS_PSA_ACCEL_ALG_xxx is set, we enable dispatching when CRYPTO_CLIENT and PSA_WANT_ALG_xxx are set. This makes the feature more useful in cases where the PSA support is provided externally, like for example TF-M in Zephyr. This commit also add proper guards for tests trying to use MD+PSA dispatch. Signed-off-by: Valerio Setti <vsetti@baylibre.com>
gilles-peskine-arm
requested changes
Feb 28, 2025
| #if defined(MBEDTLS_PSA_CRYPTO_C) | ||
|
|
||
| #if defined(MBEDTLS_PSA_ACCEL_ALG_MD5) | ||
| #define MBEDTLS_MD_CAN_MD5 |
Contributor
There was a problem hiding this comment.
MBEDTLS_MD_CAN_xxx no longer exists in TF-PSA-Crypto.
(Ok, it's technically harmless to define it, but it's confusing, since it won't be used.)
Merged
7 tasks
The previous change that replaced CRYPTO_C with CRYPTO_CLIENT caused an increase of the mbedtls_md struct in scenarios where the hash related PSA_WANTs were enabled, but not accelerated. This caused an ABI-API break which is not allowed for an LTS branch. Since the main goal here is to allow PSA dispatch in a "pure crypto client" scenario, we partially revert the previous change to config_adjust_legacy_crypto.h and add an extra condition for "CRYPTO_CLIENT && !CRYPTO_C". This commit also reverts changes done in analyze_outcomes.py because they are no more necessary. Signed-off-by: Valerio Setti <vsetti@baylibre.com>
This allows any implementer of the PSA client interface to easily include this header and therefore function's prototype. Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
Signed-off-by: Valerio Setti <vsetti@baylibre.com>
459c101 to
c50d397
Compare
Merged
6 tasks
Contributor
|
The only CI failure is fixed by the companion Mbed TLS PR Mbed-TLS/mbedtls#10027 so it is acceptable. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
This is the forward porting of Mbed-TLS/mbedtls#9562.
I'm opening the PR here instead of the main repo because MD was moved in this one.
I (manually 1) copied all the commits from Mbed-TLS/mbedtls#9562 a part:
PR checklist
Footnotes
because I didn't find a way to make git to help me with this (I tried
cherry-pick,format-patch+am,diff+apply). ↩