Skip to content

Commit

Permalink
Allow to find hidden HW-feature objects using C_FindObjectsInit
Browse files Browse the repository at this point in the history
C_FindObjectsInit has special handling for objects with
CKA_CLASS = CKO_HW_FEATURE as well as CKA_HIDDEN = TRUE.
This fix allows to find hidden HW-feature objects.

Without this fix, when CKA_HIDDEN = TRUE is found first in
the template, then CKA_CLASS = CKO_HW_FEATURE is ignored.
Also when CKA_CLASS = CKO_HW_FEATURE is found first, then
CKA_HIDDEN = TRUE is ignored. This causes that either hidden
or HW-feature objects can be searched for, but not both
together.

Signed-off-by: Ingo Franzki <[email protected]>
  • Loading branch information
Ingo Franzki authored and dodys committed Nov 21, 2017
1 parent be221a4 commit 80168b6
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions usr/lib/pkcs11/common/obj_mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1203,15 +1203,13 @@ object_mgr_find_init( STDLL_TokData_t *tokdata,
if (pTemplate[i].type == CKA_CLASS) {
if (*(CK_ULONG *)pTemplate[i].pValue == CKO_HW_FEATURE) {
fa.hw_feature = TRUE;
break;
}
}

/* only find CKA_HIDDEN objects if its specified in the template. */
if (pTemplate[i].type == CKA_HIDDEN) {
if (*(CK_BBOOL *)pTemplate[i].pValue == TRUE) {
fa.hidden_object = TRUE;
break;
}
}
}
Expand Down

0 comments on commit 80168b6

Please sign in to comment.