summaryrefslogtreecommitdiff
path: root/src/slot.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/slot.c')
-rw-r--r--src/slot.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/slot.c b/src/slot.c
index e7f8478..6919846 100644
--- a/src/slot.c
+++ b/src/slot.c
@@ -393,3 +393,26 @@ p11t_slot_tests(void)
slot_events();
slot_mechanisms();
}
+
+CK_TOKEN_INFO_PTR
+p11t_slot_get_token_info(CK_SLOT_ID slot)
+{
+ CK_ULONG i;
+
+ for(i = 0; i < p11t_slot_count; ++i)
+ {
+ if(slot == p11t_slot_ids[i])
+ {
+ if(p11t_slot_info[i].flags & CKF_TOKEN_PRESENT)
+ {
+ return &p11t_slot_token_info[i];
+ }
+ else
+ {
+ return NULL;
+ }
+ }
+ }
+
+ return NULL;
+}