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
Implement implicit rejection for RSA PKCS#1 v1.5 de-padding #737
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ifranzki
force-pushed
the
consttime-fixes
branch
from
January 19, 2024 08:03
c1ccae9
to
e391e57
Compare
Fixed segfaults in travis runs. |
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
Return code handling of C_Decrypt, C_DecryptUpdate, and C_DecryptFinal must be performed in a constant time manner for RSA mechanisms. Otherwise it may cause a timing side channel that may be used to perform a Bleichenbacher style attack. Handling of error situations with CKR_BUFFER_TOO_SMALL or size-query calls, where the output buffer is NULL and the required size of the output buffer is to be returned, do not need to be performed in constant time, since these cases are shortcut anyway, and the result is only dependent on the modulus size of the RSA key (which is public information anyway). Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
ifranzki
force-pushed
the
consttime-fixes
branch
from
January 19, 2024 10:04
e391e57
to
9ab10dd
Compare
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
ifranzki
force-pushed
the
consttime-fixes
branch
from
January 19, 2024 13:02
9ab10dd
to
6e2a139
Compare
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
jschmidb
reviewed
Jan 19, 2024
ifranzki
force-pushed
the
consttime-fixes
branch
from
January 22, 2024 07:52
6e2a139
to
625fe04
Compare
jschmidb
reviewed
Jan 22, 2024
jschmidb
reviewed
Jan 22, 2024
jschmidb
approved these changes
Jan 22, 2024
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.
looks good besides of the two last typos ...
…ding Implicit rejection returns a pseudo random message in case the RSA PKCS#1 v1.5 padding is incorrect, but returns no error. The pseudo random message is based on static secret data (the private exponent) and the provided ciphertext, so that the attacker cannot determine that the returned value is randomly generated instead of the result of decryption and de-padding. The implicit rejection algorithm is the same as used by OpenSSL. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
ifranzki
force-pushed
the
consttime-fixes
branch
from
January 22, 2024 08:54
625fe04
to
cee1d66
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.