- Newest
- Most votes
- Most comments
The issue you're experiencing with AWS CloudHSM and ECDH key derivation is a known limitation of the current implementation. Unfortunately, with the current setup, it's not possible to extract the derived secret key directly from the HSM while maintaining full FIPS compliance.
When using CKM_ECDH1_DERIVE in AWS CloudHSM, the key derivation process is performed in multiple steps, with some operations happening on the client side. This means that intermediate results from each step are available on the client, but the final derived key is imported into the HSM and cannot be directly extracted if you want to maintain FIPS boundary compliance.
The behavior you're seeing where the derivation succeeds with CKA_SENSITIVE set to true and CKA_EXTRACTABLE set to false is the expected behavior for maintaining key security within the HSM. However, this prevents you from extracting the secret for your custom key derivation function.
If your application absolutely requires the ability to extract the derived secret for further processing, you may need to consider alternative approaches:
-
If FIPS compliance is not a strict requirement for your use case, you could perform the ECDH key derivation entirely on the client side using a different cryptographic library.
-
If you're implementing SSL/TLS offload with AWS CloudHSM, this limitation may not be an issue for your specific use case.
-
You might need to explore using a different key agreement protocol that doesn't rely on ECDH key derivation and is fully supported within the HSM.
AWS is aware of this limitation and is working on developing an option to perform ECDH key derivation entirely within the HSM. When this becomes available, it will be announced in the AWS CloudHSM version history. Until then, you'll need to work within the current constraints or explore alternative solutions based on your specific security requirements.
Sources
Known issues for the JCE SDK for AWS CloudHSM - AWS CloudHSM
answered 2 years ago
Relevant content
asked a year ago
asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
