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

OAEP bug fix for non-deterministically failing on decryption #11

Closed
wants to merge 4 commits into from
Closed

OAEP bug fix for non-deterministically failing on decryption #11

wants to merge 4 commits into from

Conversation

hoylen
Copy link
Contributor

@hoylen hoylen commented May 21, 2020

Bug fix for "RSA with OAEP fails nondeterministically" issue (reported at PointyCastle/pointycastle#177 on the old repository before the management of Pointy Castle was moved over to under the Bouncy Castle project).

This also solves the mystery of the redundant code from Bouncy Castle. Bouncy Castle's RSA decryption method returns a new array and the code then copied it into a new block. Pointy Castle creates a block and passes it into the RSA decryption method to populate, so no copying was/is required. But the Bouncy Castle code does more than just copying the bytes: it is also taking care of the situation when the decrypted bytes is shorter than expected.

Note: the encryption code was correct. Only the decryption code had a bug.

@mwcw
Copy link
Collaborator

mwcw commented May 25, 2020

Thanks for the contribution.

This PR has been merged with some additional tests.

Thanks again

MW

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants