Add SHA3 support - #44
Conversation
|
Thanks for the PR. Which HSM/libraries have you tested this with? |
|
I tested using SoftHSM2 v2.5 and my company uses the Thales nShield Connect XC HSM in production. We have been running this patchset on our production HSMs for over 8 months now without any issues. |
|
Sorry for the out of hand PR. This change is now based ontop of PR #41 to prevent merge conflict. However, there is no local branch so it looks like this change is pulling in additional commits from #41. Please ignore these additional commits and just focus on the following 2 commits: This will get cleaned up once PR #41 gets merged. I created a local PR that will show just the 2 commits in my forked repo: |
334d6e4 to
9393ba1
Compare
That's helpful. I will add some comments there. |
SHA3 is not yet supported by most HSM solutions and probably wont be for a few more years. This change adds a hybrid solution that performs the EMSA-PSS and RSAES-OAEP encoding/decoding schemes in software and uses the HSM for raw encryption/decryption support. This allows the keys to continue to be protected by the HSM but still have access to newer hash algorithms.
Native RSA currently does not support SHA3 hash algorithms. This change skips the SHA3 tests when performing the native unit tests.
|
Thanks for this PR, and apologies it sat unanswered for so long — that's on us, not on We're going to close it without merging. The blocker is the hybrid PSS path, not SHA3. The PKCS#1 v1.5 half of this PR is That inverts the property people use this library for. crypto11 is a thin binding
We'd rather return an error for a mechanism the token doesn't implement than silently The good news: the native answer now exists. When this PR was written (2019),
And In 2026 the big project for
The other big project for 2026 is giving + moving the crypto11 project under the Eclipse Foundation. |
This commit adds SHA3 support for use with the RSA PKCS#1 crypto algorithms. This is an odd PR as SoftHSM2 does not yet support SHA3 and Thales HSMs only support PKCS#1 v1.5 (no PSS support).
My company makes hardware devices that will support SHA3 hash algorithms with RSASSA-PSS to be future compatible. This change adds native support for RSASSA-PKCS1-v1_5 since the algorithm IDs are prefixed to the hash before sending to request to the HSM.
However, RSASSA-PSS is a little more involved. The solution I came up with is a hybrid approach where the EMSA-PSS encoding is done in solftware but the encryption/decryption of the encrypted message is performed by the HSM.
I validated this change using SoftHSM and Go 1.12.5 and all of the test cases passed locally.