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

Simplify bitlen handling in psa_crypto_rsa.c #8780

Open
gilles-peskine-arm opened this issue Feb 1, 2024 · 0 comments
Open

Simplify bitlen handling in psa_crypto_rsa.c #8780

gilles-peskine-arm opened this issue Feb 1, 2024 · 0 comments
Labels
component-crypto Crypto primitives and low-level interfaces enhancement size-xs Estimated task size: extra small (a few hours at most)

Comments

@gilles-peskine-arm
Copy link
Contributor

There is some waffling in psa_crypto_rsa.c around the length of RSA keys because historically there was poor support for non-byte-aligned keys: mbedtls_pk_get_bitlen gave the wrong result and there was no mbedtls_rsa_get_bitlen, only mbedtls_rsa_get_len. Since #8779 this can be cleaned up.

Prerequisites: #8779 (+ backport), #8740 (which touches the same code).

Goal: update obsolete comments and simplify the code if doable (avoid going back and forth between bits and bytes). Applies to 2.28 as well.

Note that PSA does not accept non-byte-aligned RSA keys. This would be a separate feature. There may be other parts of the code to fix and we'd need tests.

@gilles-peskine-arm gilles-peskine-arm added enhancement component-crypto Crypto primitives and low-level interfaces size-xs Estimated task size: extra small (a few hours at most) labels Feb 1, 2024
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 enhancement size-xs Estimated task size: extra small (a few hours at most)
Projects
None yet
Development

No branches or pull requests

1 participant