summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-12-23 16:01:08 +0000
committerStef Walter <stef@memberwebs.com>2008-12-23 16:01:08 +0000
commitcd91ec0ef91028fb7e42cfaeab58bca46b8ca972 (patch)
tree669f13fd551a85b15234e7ce28365b465d59dc5f /src
parentdf3faf4d095a4a5eaa93d1e13f69fa92d4aa14fe (diff)
Some fine tuning and bug fixes.
Diffstat (limited to 'src')
-rw-r--r--src/key.c2
-rw-r--r--src/object.c6
2 files changed, 6 insertions, 2 deletions
diff --git a/src/key.c b/src/key.c
index fa4cd33..0d2826e 100644
--- a/src/key.c
+++ b/src/key.c
@@ -457,7 +457,7 @@ p11t_key_tests(void)
{
slot = p11t_slot_get_id(j);
session = p11t_session_open(slot, 0);
- if(!session)
+ if(session == CK_INVALID)
continue;
klass = CKO_PUBLIC_KEY;
diff --git a/src/object.c b/src/object.c
index c30348e..c0b8aa6 100644
--- a/src/object.c
+++ b/src/object.c
@@ -98,7 +98,7 @@ test_find_objects(CK_SESSION_HANDLE session)
rv = (p11t_module_funcs->C_FindObjectsInit)((CK_SESSION_HANDLE)-99, &dummy, 0);
P11T_CHECK_RV("Invalid session", rv, CKR_SESSION_HANDLE_INVALID);
- rv = (p11t_module_funcs->C_FindObjectsInit)((CK_SESSION_HANDLE)-99, NULL, 1);
+ rv = (p11t_module_funcs->C_FindObjectsInit)(session, NULL, 1);
P11T_CHECK_RV("Attribute count without buffer", rv, CKR_ARGUMENTS_BAD);
}
@@ -181,6 +181,7 @@ test_get_attribute_value(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object)
P11T_SECTION("C_GetAttributeValue");
+ memset(&attrs, 0, sizeof(attrs));
attrs[0].type = CKA_CLASS;
if(p11t_test_unexpected)
@@ -438,6 +439,9 @@ p11t_object_find_one(CK_SESSION_HANDLE session, CK_ATTRIBUTE_PTR attrs,
if((p11t_module_funcs->C_FindObjects)(session, &object, 1, &count) != CKR_OK)
return CK_INVALID;
+ if((p11t_module_funcs->C_FindObjectsFinal)(session) != CKR_OK)
+ return CK_INVALID;
+
if(count != 1)
return CK_INVALID;