[gp11] Open readonly sessions when enumerating objects.
authorStef Walter <stef@memberwebs.com>
Sun, 11 Jul 2010 23:17:20 +0000 (23:17 +0000)
committerStef Walter <stef@memberwebs.com>
Sun, 11 Jul 2010 23:17:20 +0000 (23:17 +0000)
 * This is an interim measure. When GP11 is redone the API
   should allow the caller to specify this.

gp11/gp11-module.c

index ac1d619..7255724 100644 (file)
@@ -1167,7 +1167,9 @@ gp11_module_enumerate_objects_full (GP11Module *self, GP11Attributes *attrs,
        slots = gp11_module_get_slots (self, TRUE);
 
        for (l = slots; ret && !stop && l; l = g_list_next (l)) {
-               session = gp11_slot_open_session (l->data, CKF_SERIAL_SESSION, &error);
+
+               /* TODO: We really should allow the caller to specify the flags, at least read-write */
+               session = gp11_slot_open_session (l->data, CKF_RW_SESSION | CKF_SERIAL_SESSION, &error);
                if (!session) {
                        g_return_val_if_fail (error != NULL, FALSE);