-
Notifications
You must be signed in to change notification settings - Fork 570
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
RSA signature verification with 1017 bit key crashes #4465
Comments
Can you post a complete test case? Checking a set of vectors generated by OpenSSL with keys in range 1024..1056 I cannot replicate this. |
Here is our example with the 1017 bit key:
|
Use Also do note that we already support ISO 9796 signature verification: either of these work already
|
Adds RSA encryption and signature tests for RSA keys between 1024 and 1088 bits. Generated using OpenSSL. Also add an explicit BOTAN_ARG_CHECK that the input to encryption is not too large. Previously this would fail due to a BOTAN_ASSERT, leading to an Internal_Error exception. See #4465
We need it for testing purposes. That is why we use the low level algorithm and unusual key sizes. |
That’s fine. But you can’t expect to use PK_Encryptor for this purpose, it places limits on the bitlength of encrypted inputs which is needed for other padding schemes to work correctly. #4467 changes this so that the error is |
The Reason is an insufficient buffer size created at
pk_ops.cpp
:The check
BOTAN_ASSERT_NOMSG(output.size() >= input.size());
inEME_Raw::pad()
fails.Changing the buffer size to
(max_raw + 7) / 8 + 1
fixes the problem.Probably the error occurs for all keys with
size % 8 = 1
.We use various and exotic key sizes for testing purposes.
The text was updated successfully, but these errors were encountered: