-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Remove component uses of MBEDTLS_ECDSA_DETERMINISTIC
#10367
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
Remove component uses of MBEDTLS_ECDSA_DETERMINISTIC
#10367
Conversation
Remove all references to MBEDTLS_ECDSA_DETERMINISTIC from components-configuration-crypto.sh. Replace them with PSA_WANT_ALG_DETERMINISTIC_ECDSA. This is safe because: * MBEDTLS_ECDSA_DETERMINISTIC is only ever unset in components in order to avoid errors from disabling its dependency MBEDTLS_HMAC_DRBG_C. * MBEDTLS_ECDSA_DETERMINISTIC is only ever defined in config_adjust_legacy_from_psa.h, and only if PSA_WANT_ALG_DETERMINISTIC_ECDSA is defined. Therefore PSA_WANT_ALG_DETERMINISTIC_ECDSA's dependencies are a superset of MBEDTLS_ECDSA_DETERMINISTIC's dependencies and must include MBEDTLS_HMAC_DRBG_C, so disabling PSA_WANT_ALG_DETERMINISTIC_ECDSA is a sufficient substitute for disabling MBEDTLS_ECDSA_DETERMINISTIC. Signed-off-by: David Horstmann <david.horstmann@arm.com>
MBEDTLS_ECDSA_DETERMINISTIC
| scripts/config.py full | ||
| scripts/config.py unset MBEDTLS_HMAC_DRBG_C | ||
| scripts/config.py unset MBEDTLS_ECDSA_DETERMINISTIC # requires HMAC_DRBG | ||
| scripts/config.py -c $CRYPTO_CONFIG_H unset PSA_WANT_ALG_DETERMINISTIC_ECDSA # requires HMAC_DRBG |
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.
| scripts/config.py -c $CRYPTO_CONFIG_H unset PSA_WANT_ALG_DETERMINISTIC_ECDSA # requires HMAC_DRBG | |
| scripts/config.py unset PSA_WANT_ALG_DETERMINISTIC_ECDSA # requires HMAC_DRBG |
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.
"-c $CRYPTO_CONFIG_H was necessary at some point, but hasn't been for a while now. I had been planning to clean it up eventually. I know this isn’t the main focus of this PR, but would you mind cleaning it up across all the components-*.sh scripts?"
This is no longer needed as config.py knows where the crypto config file is these days. Signed-off-by: David Horstmann <david.horstmann@arm.com>
ronald-cron-arm
left a comment
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.
There are some "scripts/config.py -f "$CRYPTO_CONFIG_H" instances as well and please do the change in the other components-*.sh as well.
Remove unnecessary passing of the crypto config filename either with the '-f' or '-c' switch, throughout all of the all.sh component files. Signed-off-by: David Horstmann <david.horstmann@arm.com>
Sorry, I missed those, that should be done now. |
ronald-cron-arm
left a comment
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.
LGTM, thanks.
valeriosetti
left a comment
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.
The PR looks OK to me. I have a couple of questions though:
- now that we removed
MBEDTLS_ECDSA_DETERMINISTICfrom the mbedtls repo, shouldn't we also comment this line out? - I just realized that there are still a couple of usages of
MBEDTLS_ECDSA_DETERMINISTICin tf-psa-crypto (here and here). Do you think it's worth creating a new issue for the future to clean these up as well?
I think the answer is yes to both, but the script is about converting testcases from legacy to PSA dependencies, so I think both of these can be done in one task. |
|
I've created #10380 as a followup. |
Fixes #10328
Remove all references to
MBEDTLS_ECDSA_DETERMINISTICfromcomponents-configuration-crypto.sh. Replace them withPSA_WANT_ALG_DETERMINISTIC_ECDSA.This is safe because:
MBEDTLS_ECDSA_DETERMINISTICis only ever unset in components in order to avoid errors from disabling its dependencyMBEDTLS_HMAC_DRBG_C.MBEDTLS_ECDSA_DETERMINISTICis only ever defined inconfig_adjust_legacy_from_psa.h, and only ifPSA_WANT_ALG_DETERMINISTIC_ECDSAis defined.Therefore
PSA_WANT_ALG_DETERMINISTIC_ECDSA's dependencies are a superset ofMBEDTLS_ECDSA_DETERMINISTIC's dependencies and must includeMBEDTLS_HMAC_DRBG_C, so disablingPSA_WANT_ALG_DETERMINISTIC_ECDSAis a sufficient substitute for disablingMBEDTLS_ECDSA_DETERMINISTIC.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.