summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/object.c b/src/object.c
index adfd86e..87f89e2 100644
--- a/src/object.c
+++ b/src/object.c
@@ -319,12 +319,14 @@ p11t_object_tests(void)
{
CK_SESSION_HANDLE session_rw;
CK_SESSION_HANDLE session_ro;
+ CK_SLOT_ID slot;
CK_ULONG i;
for(i = 0; i < p11t_slot_count; ++i)
{
- session_rw = p11t_session_open(p11t_slot_ids[i], 1);
- session_ro = p11t_session_open(p11t_slot_ids[i], 0);
+ slot = p11t_slot_get_id(i);
+ session_rw = p11t_session_open(slot, 1);
+ session_ro = p11t_session_open(slot, 0);
/* We need to have the readonly session and log in for tests to proceed */
if(session_ro == CK_INVALID)
@@ -348,7 +350,7 @@ p11t_object_tests(void)
destroy_object(session_rw, session_ro);
}
- p11t_session_close_all(p11t_slot_ids[i]);
+ p11t_session_close_all(slot);
}
}