Skip to content
This repository was archived by the owner on May 7, 2026. It is now read-only.
This repository was archived by the owner on May 7, 2026. It is now read-only.

Issue of querying multiple keys in CTK with API C_FindObjects #8

Description

@qiming-007

After creating multiple key pairs in CTK, then try to find specified one with API C_FindObjects using CKA_CLASS + CKA_LABEL in template, but always the first key handle will be returned (probably not match with the key label). Here is the pseudocode:

CK_ATTRIBUTE template[] = {
        {CKA_CLASS, &key_class, sizeof(key_class)},
        {CKA_LABEL, key_lable, strlen(key_lable)}
        
 };
p11_->C_FindObjectsInit(sessionhandle_, template, cnt)
CK_ULONG object_count = 1;
CK_ULONG expected_obj_count = 1;
p11_->C_FindObjects(sessionhandle_, &object_handle, expected_obj_count, &object_count)
//the object_handle are actually not matched with key_lable. Even change to key_lable to another valid one, the
//return object_handle always the same one.

With CKA_CLASS + CKA_ID, same problem.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions