-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add support for RSA PSS and OAEP padding schemes #6
Conversation
7fb96f1
to
37552c0
Compare
OpenSSL does not consider the padding type except for special TLS padding, so even though it should know that PKCS1 1.5 padding implies the output can't be larger than modulus length - 11, the decrypt function requires a full modulus long output buffer. Use a support buffer to bridge the required len if the application provides a buffer that is long enough according to the PKCS#11 spec but openssl considers too short. Signed-off-by: Simo Sorce <[email protected]>
This allows in future to support different implementations haveing support for different mechanisms for the same algorithm family. Signed-off-by: Simo Sorce <[email protected]>
I should have addressed all the items except for mgf1_to_digest_buf() name one. |
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.
I think this is good to go regardless how the OAEP labels will evolve or the digest name buffers will change or not to avoid delaying the review more than needed.
Signed-off-by: Simo Sorce <[email protected]>
Signed-off-by: Simo Sorce <[email protected]>
Signed-off-by: Simo Sorce <[email protected]>
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.
one last typo in the tests comment, but it can be fixed later.
Uses some vectors obtained from https://github.com/pyca/cryptography/blob/main/vectors/cryptography_vectors/asymmetric/RSA Signed-off-by: Simo Sorce <[email protected]>
Reuse the existing rsa_import function already use for private keys. Move the constants in the implementation where they belong as the supported key sizes depend on the implementation used. Change the minimum key size in the fips implementation to reflect the actual minimum for that implemenation. Signed-off-by: Simo Sorce <[email protected]>
Signed-off-by: Simo Sorce <[email protected]>
Merged! @Jakuje thanks for the thorough reviews! |
Change Rsa code to allow PSS and OAEP mechanisms