bentonstark / py-hsm

Python module for accessing PKCS#11 compliant HSMs
Other
57 stars 18 forks source link

CKR_CRYPTOKI_NOT_INITIALIZED - AWS CloudHSM #13

Closed ghost closed 3 years ago

ghost commented 3 years ago

Benton - I have been playing with your library and stuck on open_session. I am using it with AWS CloudHSM and the SDK 3. I have managed to create an HsmClient, using:

c = HsmClient(pkcs11_lib="/opt/cloudhsm/lib/libcloudhsm_pkcs11.so")

But, everything else returns a:

'open_session: PKCS#11 C_OpenSession on slot 1 failed with return value 400. CKR_CRYPTOKI_NOT_INITIALIZED (0x00000190)'

Not clear if I am missing a step or if there is an issue on the AWS side. Any thoughts would be greatly appreciated.

Thanks,

Kyle

bentonstark commented 3 years ago

Have you confirmed the hsm is accessible using other tools?

Sent from my iPhone

On Apr 16, 2021, at 7:44 PM, Atlmirai LLC @.***> wrote:

 Benton - I have been playing with your library and stuck on open_session. I am using it with AWS CloudHSM and the SDK 3. I have managed to create an HsmClient, using:

c = HsmClient(pkcs11_lib="/opt/cloudhsm/lib/libcloudhsm_pkcs11.so")

But, everything else returns a:

'open_session: PKCS#11 C_OpenSession on slot 1 failed with return value 400. CKR_CRYPTOKI_NOT_INITIALIZED (0x00000190)'

Not clear if I am missing a step or if there is an issue on the AWS side. Any thoughts would be greatly appreciated.

Thanks,

Kyle

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

ghost commented 3 years ago

OK, that solved that problem. For anyone else who might come across this. I configured the cloudhsm_client and mgmt_util before the HSM was active.

Thanks, Benton

bentonstark commented 3 years ago

Excellent! Let me know if you run into any other issues.