-
-
Notifications
You must be signed in to change notification settings - Fork 10k
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
X509_check_private_key() does not honor RSA_METHOD_FLAG_NO_CHECK flag #8767
Comments
The question is also whether the type mismatch for RSA private key and RSASSA-PSS public key from c certificate should not be handled on lower level in EVP_PKEY_cmp(). |
Is anyone working on this issue? |
I don't think anyone is currently working on this. I will also note in closing that if you have a scheme in place that uses, e.g., an ENGINE for private key operations, you can get around the openssl consistency checks by telling openssl that the private key has the same value as the public key. (This is not a guarantee that doing so will continue to work indefinitely; just an observation about the current state of things.) |
The version 1.1.1 is not supported anymore. Closing. If this is still an issue with currently supported releases, please open a new issue. |
So you closed this issue based on the fact that @levitte marked it as affecting OpenSSL 1.1.1, which was the latest stable branch at the time, and the master branch. Interesting. |
Given the engines are deprecated I do not think it makes sense to keep the issue open as it will not be a priority for the team to fix it. But yeah, I can reopen it if anybody wants to try to tackle it. |
The
X509_check_private_key()
function ignores theRSA_METHOD_FLAG_NO_CHECK
set in the RSA key structure and tries to check if the public key information of the private key matches the public key from the certificate.This is especially problematic for keys obtained from engines that explicitly set the flag to prevent this match check from occurring.
For instance, the PKCS#11 standard does not differentiate RSA and RSASSA-PSS key objects, there is only one common type for both (CKK_RSA). OpenSSL uses different types for RSA and RSASSA-PSS keys. The engine can set the
RSA_METHOD_FLAG_NO_CHECK
flag to prevent OpenSSL from comparing the types of an RSASSA-PSS public key obtained from a certificate with the type contained in an RSA private key object provided by the engine.The text was updated successfully, but these errors were encountered: