Conversation
se-lo
commented
Sep 11, 2026
- Daemon impl does already call provider in multi-threaded manner
- Pass corresponding option to PKCS#11 Init()
- Build openssl with multi-thread option
- Pass dummy path for pkcs11_lib in pre-commit bazel-compile-commands to fix pre-commit hooks
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
Documentation preview for this pull request is available at: |
| CK_C_INITIALIZE_ARGS init_args{}; | ||
| // Set CKF_OS_LOCKING_OK since the daemon will use it in a multi-threaded manner. | ||
| init_args.flags = CKF_OS_LOCKING_OK; | ||
| const auto initResult = pkcs11Module->Init(&init_args); |
There was a problem hiding this comment.
@ShoroukRamzy & @schreibwsag I would like your feedback on this point.
The daemon intents to use the pkcs11 module concurrently from multiple threads. Previously, we did not indicate this during C_Initialize().
We now set CKF_OS_LOCKING_OK to inform the pkcs11 module that we use it concurrently and it may use the OS locking mechanisms.
Please check whether the pkcs11 module(s) in use support this mode and whether you have any concerns.
There was a problem hiding this comment.
I'm interested in the pkcs11 module pkcs11-hse from NXP.
Looking at the source code, CKF_OS_LOCKING_OK seems to be supported. I will check with NXP, but my
assumption is that is supported.
There was a problem hiding this comment.
Hi @se-lo, Yes, The rust cryptoki lib supports CKF_OS_LOCKING_OK via internal parking_lot / RwLock primitives.
SoftHSM supports it as well.