-
Notifications
You must be signed in to change notification settings - Fork 348
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
ANSI X9.63 key derivation functions for CKM_ECDH1_DERIVE #599
base: develop
Are you sure you want to change the base?
Conversation
Thanks for the contribution, much appreciated! Code looks good to me, I'm going to discuss it internally, we are having some challenges with the review process due to corona-related pressure on time available to collaborators, so bear with us for some time (apologies in advance). |
Very interested in this PR |
Hello @Aearsis, |
I was unable to test rust-cryptoki on some vendor HSM with FIPS restriction that refuses to derive keys with CKD_NULL. I was successful however with CKD_SHA256_KDF. Unfortunately this is not implemented on softHSM (softhsm/SoftHSMv2#599) so I provide no test. This was tested fine on Thales DPOD. Signed-off-by: François Rigault <rigault.francois@gmail.com>
Define CKD_SHA256_KDF transformation to be used with CKM_ECDH1_DERIVE. Some HSM with FIPS restriction will refuse to derive keys with CKD_NULL. CKD_SHA256_KDF will do fine though. Unfortunately this is not implemented on softHSM (softhsm/SoftHSMv2#599) so I provide no test. This was tested fine against Thales DPOD. Signed-off-by: François Rigault <rigault.francois@gmail.com>
Define CKD_SHA256_KDF transformation to be used with CKM_ECDH1_DERIVE. Some HSM with FIPS restriction will refuse to derive keys with CKD_NULL. CKD_SHA256_KDF will do fine though. Unfortunately this is not implemented on softHSM (softhsm/SoftHSMv2#599) so I provide no test. This was tested fine against Thales DPOD. Signed-off-by: François Rigault <rigault.francois@gmail.com>
Please rebase on develop and mark as ready when ready. |
Signed-off-by: Ondřej Hlavatý <aearsis@eideo.cz>
Signed-off-by: Ondřej Hlavatý <aearsis@eideo.cz>
Define CKD_SHA256_KDF transformation to be used with CKM_ECDH1_DERIVE. Some HSM with FIPS restriction will refuse to derive keys with CKD_NULL. CKD_SHA256_KDF will do fine though. Unfortunately this is not implemented on softHSM (softhsm/SoftHSMv2#599) so I provide no test. This was tested fine against Thales DPOD. Signed-off-by: François Rigault <rigault.francois@gmail.com>
Implemented in
SoftHSM.cpp
, so it works with both OpenSSL and Botan backends. The added tests are kind of elementary, I haven't found any official test vectors. But I have checked the results against doing the SHA's by hand, and against OpenSSL's internal implementation.It would be awesome if someone could check the outputs with another PKCS#11 implementation.