-
Notifications
You must be signed in to change notification settings - Fork 14
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
Only omit RSA primes if precomputed values are missing in OpenSSL 3.0 and 3.1 #163
Conversation
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.
Can / Should we add a test for this?
Good point. I've added some tests and, while here, improved a bit all the RSA tests. |
@qmuntal will need a rebase now |
Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
@ueno can you take a look at this? Thanks. |
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!
… and 3.1 (golang-fips#163) * only allow omission of precomputed RSA values in OpenSSL 3.0 and 3.1 * check if rsa primes and precomputed values exists * make logic more clear * Update rsa.go Co-authored-by: Davis Goodin <dagood@users.noreply.github.com> * add tests * exhaustively tests messing precomputed values --------- Co-authored-by: Davis Goodin <dagood@users.noreply.github.com>
Since OpenSSL 3.2, RSA primes can coexist with empty precomputed values, see openssl/openssl#22334.
Some providers, such as SymCrypt, compute the RSA private key using the prime numbers
P
andQ
instead of loading it from the private exponentD
. So they always needP
andQ
, even if the precomputed values are omitted. This means that these providers are not fully compatible with OpenSSL 3.0 and 3.1, but they do work with OpenSSL 3.2 and higher.This PR relaxes the restriction added in #136 to only take effect with OpenSSL 3.0 and 3.1.