Removed unnecessary includes, explicitly zero-fill structures, add #pragma pack
to the CloudHSM vendor defined include file so that the SDK can properly align
structures for Linux and Windows.
Testing
Note Testing using SDK 5.x, so unwrap_with_template and ecdh are not yet supported samples
Linux
ubuntu@ip-172-31-13-165:~/aws-cloudhsm-pkcs11-examples/build$ make test
Running tests...
Test project /home/ubuntu/aws-cloudhsm-pkcs11-examples/build
Start 1: digest
1/23 Test #1: digest ........................... Passed 0.20 sec
Start 2: aes_generate
2/23 Test #2: aes_generate ..................... Passed 0.29 sec
Start 3: rsa_generate
3/23 Test #3: rsa_generate ..................... Passed 0.30 sec
Start 4: ec_generate
4/23 Test #4: ec_generate ...................... Passed 0.40 sec
Start 5: sign
5/23 Test #5: sign ............................. Passed 0.42 sec
Start 6: multi_part_sign
6/23 Test #6: multi_part_sign .................. Passed 0.44 sec
Start 7: aes_cbc
7/23 Test #7: aes_cbc .......................... Passed 0.25 sec
Start 8: aes_ecb
8/23 Test #8: aes_ecb .......................... Passed 0.30 sec
Start 9: aes_gcm
9/23 Test #9: aes_gcm .......................... Passed 0.29 sec
Start 10: aes_ctr
10/23 Test #10: aes_ctr .......................... Passed 0.25 sec
Start 11: des_ecb
11/23 Test #11: des_ecb .......................... Passed 0.25 sec
Start 12: aes_gcm_wrapping
12/23 Test #12: aes_gcm_wrapping ................. Passed 0.51 sec
Start 13: aes_no_padding_wrapping
13/23 Test #13: aes_no_padding_wrapping .......... Passed 0.42 sec
Start 14: aes_zero_padding_wrapping
14/23 Test #14: aes_zero_padding_wrapping ........ Passed 0.48 sec
Start 15: aes_wrapping
15/23 Test #15: aes_wrapping ..................... Passed 0.50 sec
Start 16: rsa_wrapping
16/23 Test #16: rsa_wrapping ..................... Passed 0.94 sec
Start 17: wrap_with_template
17/23 Test #17: wrap_with_template ............... Passed 0.46 sec
Start 18: unwrap_with_template
18/23 Test #18: unwrap_with_template .............***Failed 0.25 sec
Start 19: mechanism_info
19/23 Test #19: mechanism_info ................... Passed 0.21 sec
Start 20: find_objects
20/23 Test #20: find_objects ..................... Passed 0.41 sec
Start 21: ecdh
21/23 Test #21: ecdh .............................***Failed 0.27 sec
Start 22: hmac_kdf
22/23 Test #22: hmac_kdf ......................... Passed 0.34 sec
Start 23: generate_random
23/23 Test #23: generate_random .................. Passed 0.24 sec
91% tests passed, 2 tests failed out of 23
Total Test time (real) = 8.41 sec
# these are not currently supported with SDK 5.x
The following tests FAILED:
18 - unwrap_with_template (Failed)
21 - ecdh (Failed)
Summary
Removed unnecessary includes, explicitly zero-fill structures, add #pragma pack to the CloudHSM vendor defined include file so that the SDK can properly align structures for Linux and Windows.
Testing
Note Testing using SDK 5.x, so unwrap_with_template and ecdh are not yet supported samples
Linux
Windows
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.