summaryrefslogtreecommitdiff
path: root/src/slot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/slot.c')
-rw-r--r--src/slot.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/slot.c b/src/slot.c
index 44035e8..9658ea6 100644
--- a/src/slot.c
+++ b/src/slot.c
@@ -437,6 +437,24 @@ p11t_slot_get_token_info(CK_SLOT_ID slot)
return NULL;
}
+CK_MECHANISM_INFO_PTR
+p11t_slot_get_mech_info(CK_SLOT_ID slot, CK_MECHANISM_TYPE mech)
+{
+ int i;
+ CK_ULONG j;
+
+ i = get_slot_index(slot);
+ assert(i >= 0);
+
+ for(j = 0; j < slot_mech_count[i]; ++j)
+ {
+ if(mech == slot_mech_type[i][j])
+ return &slot_mech_info[i][j];
+ }
+
+ return CK_FALSE;
+}
+
void
p11t_slot_for_each_mech(CK_MECHANISM_TYPE mech_type,
P11tSlotMechCallback callback)