Repository navigation
Conversation
|
The macOS version was already doing the slicing correctly, which the test matrix will ideally corroborate. corefx/src/Common/src/System/Security/Cryptography/RSASecurityTransforms.cs Lines 482 to 483 in 14b8073 |
|
@vcsjones There's a typo in your second commit message (OARP instead of OAEP) that'll bug me if it gets merged in with the final squash description. Would you mind force-pushing to clean it up (or even just squash the second commit into the first)? |
032c1c3 to
4538c30
Compare
|
None of the test failures look relevant |
|
Per tactics consideration, we concluded that the backport to .NET Core 3.1 is not warranted by the impact known at this time. I left a comment on the original issue; if more substantial impact is recognized, this can be reconsidered. |
Customer Impact
A customer reported in dotnet/runtime#71607 that decrypting RSA OAEP with SHA2 and a 3072-bit key on Linux resulted in a OAEP de-padding error, while other platforms were able to perform these operations successfully.
Investigation in to the issue led to uncover that RSA OAEP decryption that uses the managed implementation does not work with non-power-of-two keys because we do not slice a rented buffer accordingly. The current implementation only works because
CryptoPool.Renthappens to give back power-of-two arrays which are exactly the same size as the key.The fix is to slice the data to the correct size.
This does not affect dotnet/runtime because the managed implementation of RSA OAEP is no longer used for OpenSSL RSA decryption. This change was introduced in dotnet/runtime#50063.
Testing
Unit tests were introduced to test RSA OAEP encryption with a 3072-bit RSA key. These tests will be forward-ported to dotnet/runtime.
Risk
Minimal. The change is localized and understood that a
Slicewas missing.