aws-samples / aws-cloudhsm-pkcs11-examples

Sample applications demonstrating how to use the CloudHSM PKCS#11 library
Other
55 stars 39 forks source link

Pass strings by value instead of address in HMAC KDF sample #56

Closed nikran-amzn closed 3 years ago

nikran-amzn commented 3 years ago

Instead of passing labels in PKCS#11 samples by their addresses, pass the labels by value

hmac sample:

ubuntu@ip-172-31-0-130:~/aws-cloudhsm-pkcs11-examples/build$ ./src/derivation/hmac_kdf --pin cu1:password 2>/dev/null
Key derivation using HMAC KDF in Counter mode. Defined in NIST SP 800-108.
Generated base AES key of size 32 bytes. Handle: 4611686018427387905
Derived AES key of size 32 bytes. Handle: 4611686018427387906
ubuntu@ip-172-31-0-130:~/aws-cloudhsm-pkcs11-examples/build$ echo $?
0

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.