-
Notifications
You must be signed in to change notification settings - Fork 833
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
RFE: modernize PKCS#11 RSA mechanism to PKCS/PSS/OAEP #7739
Comments
I am interested in this feature but not sure how the wolfCrypt RSA operation splits work between software (padding/hashing(PKCS, PSS)) and CryptoDev(raw encryption/decryption). Any pointers to the source code would be very helpful. |
Hi @space88man, While it would be nice to have the whole operation done on the device, it was cleaner for our code to have only the RSA operation done down there. The wc_CryptoCb_Rsa() calls in rsa.c are where the PKCS#11 code is invoked. Note that the RSA-PSS sign could be easily modified to call a new callback, the verify is broken into two parts which would take a bit more effort but again is not difficult. Similarly the OAEP encrypt/decrypt would require new callback but would be easy to implement. Sean Sean |
Yes - it's cleaner to only dispatch the raw RSA operation and keep the rest the same. The glitch for me ATM is that LUNA disables CKM_RSA_X_509 in FIPS mode 😣. It supports raw RSA in non-FIPS mode For TLS/signing use cases (PSS/PKCS) and ignoring OAEP:
IOW, "cache" the original array and pass it down the stack together with the library-padded array in case CryptoCb wants to handle padding on its own. The semantics are: if The total number of callers to As a start do you think this is acceptable? |
Hi @space88man, My preference is to have new calls to wc_CryptoCb_Rsa higher up. Sean |
Let me work out something for WC_PK_TYPE_RSA_PKCS/PSS. |
WIP: test files both software RSA(to ensure nothing broke) and token RSA for upcoming PR for RSA PKCS-offload. NSS Softoken with RSA private key included. Token PIN is: 12345678 |
Hi @space88man , This support has been added in PR #7907. Please review and let us know if you have any feedback. Thanks, |
Version
5.7.2
Description
It is discouraged to call the raw RSA mechanims on a token
CKM_RSA_X_509
which is used by wolfCrypt PKCS#11.This mechanism is not supported by Thales LUNA.
The enhancement would be for wolfCrypt -> CryptoDev -> token to use modern mechamisms like RSA_PKCS/RSA_PKCS_PSS/RSA_PKCS_OAEP for signing and decryption.
My testing observations:
The text was updated successfully, but these errors were encountered: