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

Remove code that is only used when MBEDTLS_USE_PSA_CRYPTO is disabled #9631

Open
gilles-peskine-arm opened this issue Sep 24, 2024 · 1 comment
Labels
component-crypto Crypto primitives and low-level interfaces component-tls component-x509 size-m Estimated task size: medium (~1w)

Comments

@gilles-peskine-arm
Copy link
Contributor

gilles-peskine-arm commented Sep 24, 2024

Remove all the code that is only used when MBEDTLS_USE_PSA_CRYPTO is disabled.

Remove #define MBEDTLS_USE_PSA_CRYPTO.

Follow-up to #9630. We should also do #9676 first (not strictly required, but I think it's easier to do it in this order).

Definition of done: MBEDTLS_USE_PSA_CRYPTO no longer appears in any code. It may still appear in documentation (covered by #9632).

@gilles-peskine-arm gilles-peskine-arm added component-tls component-x509 component-crypto Crypto primitives and low-level interfaces size-xs Estimated task size: extra small (a few hours at most) labels Sep 24, 2024
@gilles-peskine-arm gilles-peskine-arm added size-s Estimated task size: small (~2d) and removed size-xs Estimated task size: extra small (a few hours at most) labels Sep 24, 2024
@gilles-peskine-arm gilles-peskine-arm moved this to Implementation in progress in Mbed TLS 4.0 planning Sep 24, 2024
@gilles-peskine-arm gilles-peskine-arm moved this from Implementation in progress to Implementation needed in Mbed TLS 4.0 planning Sep 24, 2024
@gilles-peskine-arm gilles-peskine-arm added size-m Estimated task size: medium (~1w) and removed size-s Estimated task size: small (~2d) labels Oct 9, 2024
@gilles-peskine-arm
Copy link
Contributor Author

I'm upping the size estimate. This is easy, but tedious: each place where MBEDTLS_USE_PSA_CRYPTO is used is easy or trivial to update, but there are a lot of them.

After a bit of experimentation, unifdef can help us. It seems to at least handle the simple cases correctly. Use the latest version (unifdef 2.10 errors out in many places in our code; 2.12 only chokes in three places, see https://github.com/gilles-peskine-arm/mbedtls/tree/use_psa_crypto-remove_with_unifdef-1). That still leaves many places with complex expressions like #if defined(FOO) && defined(MBEDTLS_USE_PSA_CRYPTO) that unifdef doesn't touch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component-crypto Crypto primitives and low-level interfaces component-tls component-x509 size-m Estimated task size: medium (~1w)
Projects
Status: Implementation needed
Development

No branches or pull requests

1 participant