Skip to content

Updates to better handle safenet HSMs

username-removed-105950 requested to merge tmp-handle-safenet-hsms into master

These HSMs do not support CKA_ALWAYS_AUTHENTICATE, nor understand CKU_CONTEXT_SPECIFIC, but rather return CKR_USER_NOT_LOGGED_IN on the first private key operation. Try to discover that state by calling C_Login when CKR_USER_NOT_LOGGED_IN is seen, and retrying with CKU_USER after CKU_CONTEXT_SPECIFIC login fails.

See discussion in https://github.com/OpenSC/libp11/issues/160

Edited by username-removed-105950

Merge request reports