Make RSA decryption API safe to use with PKCS#1 v1.5 padding#13817
Make RSA decryption API safe to use with PKCS#1 v1.5 padding#13817tomato42 wants to merge 7 commits into
Conversation
dfc4db8 to
fe1cb2c
Compare
|
@beldmit thanks, updated |
|
Build failures seems relevant |
fe1cb2c to
87dcfa0
Compare
|
@beldmit updated |
|
@tomato42 build failures still persist :( |
25f9b41 to
565fc7e
Compare
b04e04f to
5e8c1e7
Compare
5e8c1e7 to
71a2484
Compare
71a2484 to
04dc864
Compare
04dc864 to
5d1b481
Compare
5d1b481 to
843b27b
Compare
|
This looks good to me now, however given this is an API break we should discuss it within OTC at least. |
@t8m I am not sure if you remember this old pull-request. But may I ask you why there is currently no plan to merge it to 3.1 branch? What prevented you from backporting this PR to the OpenSSL 3.1/3.0? There is already a patch for this pull-request included in the downstream OpenSSL 3.1 RPM package on Fedora Linux 39. And there is also already a patch for this pull-request included in the downstrem OpenSSL 3.0 RPM package on Feodra Linux 38. So, I assume preparing the patches for the OpenSSL 3.1/3.0 is relatively easy. For example, if @tomato42 will send the pull-requests into both the |
|
This is clearly a feature and thus it is not eligible to be merged to stable branches. |
@t8m Thanks for your reply. If you think this PR is about a feature, not backporting to the stable branches makes sense to me. While this PR adds the While I can see the CVE-2020-25659 for python-cryptography and CVE-2020-25657 for m2crypto in |
|
No, we do not regard this issue as a security issue and we did not assign a CVE to it. |
@t8m OK. Why do you think you don't regard this issue as a security issue? Perhaps, do you think that in OpenSSL 3.1 or older versions, using the RSA decryption API safely is a responsibility of users or applications using OpenSSL C APIs? If you think so, could you create a document in this repository or somewhere to guide users about how to use the RSA decryption API safely in OpenSSL 3.1 or earlier versions? Or Is there already such a document? |
|
https://www.openssl.org/docs/man3.0/man3/RSA_private_decrypt.html The newer man page is much more explicit: |
|
@tomato42 Thanks for providing the info. OK. OpenSSL project already has such a document. |
|
I am currently in the process of debugging a problem that seems to happen in conjunction with this patch. This came to my attention due to a problem that occurred after upgrading OpenSSL to openssl-1:1.1.1k-12.el8_9.x86_64 on a Rocky Linux 8 system. The same happens on a RedHat RHEL 8 system. According to the RedHat changelogs, this patch has been backported into RedHat's OpenSSL. Problem description: I have verified that the same happens with a Nitrokey HSM2 and an nCipher Edge HSM, so I am pretty sure that the problem is not related to a particular HSM type or PKCS#11 library. After downgrading RedHat openssl to a previous version that does not include this patch, the above command works without problem. |
|
@mbartosch this should be filed as a separate issue, preferably with a complete stand-alone reproducer that being said, use of |
|
@tomato42 , does the modification in [this pull request](#23832) mean that the issue will no longer exist in OpenSSL versions after 3.4.0? [CVE-2023-50781](https://nvd.nist.gov/vuln/detail/CVE-2023-50781) |
I'm confused... #23832 is about Pairwise Consistency Tests... those have little to do with implicit rejection (this PR) CVE-2023-50781 is a bug in m2crypto... that this PR mitigates if, and only if, the |
fixes #13421
The code is functional (behaves the same as the implementation in NSS and tlslite-ng).
We need to decide if we want to cache the
d_hashvalue or not.Checklist
RSAstructure or not