Skip to content

C_Initialize could return CKR_USER_PIN_NOT_INITIALIZED #391

Description

@Jakuje

There sounds some intermittent issue where kryoptic can return CKR_USER_PIN_NOT_INITIALIZED from C_Initialize() which we hit in #341:

---- cryptoki/src/context/session_management.rs - context::session_management::Pkcs11::open_ro_session (line 47) stdout ----
Test executable failed (exit status: 101).

stderr:

thread 'main' (4188) panicked at cryptoki/src/context/session_management.rs:14:1:
error: cryptoki::error::Error - Function::Initialize: PKCS11 error: This value can only be returned by C_Login.  It indicates that the normal user’s PIN has not yet been initialized with C_InitPIN.
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /builddir/build/BUILD/rust-1.92.0-build/rustc-1.92.0-src/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /builddir/build/BUILD/rust-1.92.0-build/rustc-1.92.0-src/library/core/src/panicking.rs:80:14
   2: <testresult::TestError as core::convert::From<T>>::from
   3: <core::result::Result<T,F> as core::ops::try_trait::FromResidual<core::result::Result<core::convert::Infallible,E>>>::from_residual
   4: rust_out::main
   5: core::ops::function::FnOnce::call_once

This is not from the testsuite, but from the docstring example code so I am not completely sure on which context it runs, but it should not be sufficiently different from how other tests are executed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    deferredWill be finished later

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions