aws-samples / aws-kms-xks-proxy

AWS KMS External Keystore (XKS) Proxy reference implementation
Apache License 2.0
35 stars 11 forks source link

Enable the use of SoftHSMv2 in a concurrent environment without crashing, upgrading to v3.2.0 #33

Closed hansonchar closed 1 year ago

hansonchar commented 1 year ago

Issue #, if available:

Description of changes:

Enable the use of SoftHSMv2 in a concurrent environment without crashing, upgrading to v3.2.0

  1. Supports can_close_session HSM capability. (For SoftHSMv2, this flag must be set to false.)
  2. Initialize pkcs11 context with lock functions and upon failure would retry pkcs11 initialization without callback functions
  3. Fix memory corruption bugs in pkcs11 crate in context initialization
  4. Mark C_Initialize, Ctx::new_and_initialize and Ctx::initialize as unsafe

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Check any applicable:

hansonchar commented 1 year ago

Github has some issue linking my forked repo after changing this repo to public. Let me close this PR and create a new one.