Skip to content

Handle repeated C_Initialize and C_Finalize calls #324

@robin-nitrokey

Description

@robin-nitrokey

According to the spec:

Every call to C_Initialize should (eventually) be succeeded by a single call to C_Finalize.

https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/csd01/pkcs11-spec-v3.1-csd01.html#_Toc98177101

Each application’s call to C_Finalize should be preceded by a single call to C_Initialize

https://docs.oasis-open.org/pkcs11/pkcs11-spec/v3.1/csd01/pkcs11-spec-v3.1-csd01.html#_Toc98177102

C_Initialize should return CKR_CRYPTOKI_ALREADY_INITIALIZED if called twice, and C_Finalize should return CKR_CRYPTOKI_NOT_INITIALIZED if called without a corresponding C_Initialize call.

Currently, we just return CKR_OK in both cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions