[gnome-keyring] [pkcs11] Lookup the destruct after/idle attributes properly.



commit 185a475b81c57af7f48d1c7b8cb467b158bcdae4
Author: Stef Walter <stef memberwebs com>
Date:   Sun Feb 7 16:56:24 2010 +0000

    [pkcs11] Lookup the destruct after/idle attributes properly.
    
    When creating an object the attributes which controlled
    destruction timeouts weren't being looked up properly.

 pkcs11/gck/gck-object.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/pkcs11/gck/gck-object.c b/pkcs11/gck/gck-object.c
index ec74031..a568042 100644
--- a/pkcs11/gck/gck-object.c
+++ b/pkcs11/gck/gck-object.c
@@ -324,12 +324,13 @@ gck_object_real_create_attributes (GckObject *self, GckSession *session,
 	}
 
 	/* Parse the auto destruct attribute */
-	if (gck_attributes_find_ulong (attrs, n_attrs, CKA_G_DESTRUCT_AFTER, &after) ||
-	    gck_attributes_find_ulong (attrs, n_attrs, CKA_G_DESTRUCT_IDLE, &idle)) {
-		/* Default for the transient attribute */
-		if (!transient_attr)
-			transient = TRUE;
-	}
+	if (!gck_attributes_find_ulong (attrs, n_attrs, CKA_G_DESTRUCT_AFTER, &after))
+		after = 0;
+	if (!gck_attributes_find_ulong (attrs, n_attrs, CKA_G_DESTRUCT_IDLE, &idle))
+		idle = 0;
+	/* Default for the transient attribute */
+	if (!transient_attr && (idle || after))
+		transient = TRUE;
 
 	/* Used up these attributes */
 	gck_attributes_consume (attrs, n_attrs, CKA_G_DESTRUCT_AFTER,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]