[gnome-keyring/dbus-api] [secret-store] Only return CKR_USER_NOT_LOGGED_IN when attribute valid.



commit 74af3a973c4d8c39f7022992849a233d8a6ac847
Author: Stef Walter <stef memberwebs com>
Date:   Sun Aug 30 18:52:48 2009 +0000

    [secret-store] Only return CKR_USER_NOT_LOGGED_IN when attribute valid.
    
    Don't return CKR_USER_NOT_LOGGED_IN for any attribute that is being
    set on a collection or item. Only when the attribute is valid and
    not a read-only attribute.

 pkcs11/secret-store/gck-secret-object.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)
---
diff --git a/pkcs11/secret-store/gck-secret-object.c b/pkcs11/secret-store/gck-secret-object.c
index 19cb106..9ca01a9 100644
--- a/pkcs11/secret-store/gck-secret-object.c
+++ b/pkcs11/secret-store/gck-secret-object.c
@@ -120,17 +120,15 @@ gck_secret_object_set_attribute (GckObject *base, GckSession *session,
 	GckSecretObject *self = GCK_SECRET_OBJECT (base);
 	gchar *label;
 	CK_RV rv;
-	
-	/* Check that the object is not locked */
-	if (gck_secret_object_is_locked (self, session)) {
-		gck_transaction_fail (transaction, CKR_USER_NOT_LOGGED_IN);
-		return;
-	}
-	
+
 	switch (attr->type) {
 	
 	case CKA_LABEL:
-		rv = gck_attribute_get_string (attr, &label);
+		/* Check that the object is not locked */
+		if (gck_secret_object_is_locked (self, session))
+			rv = CKR_USER_NOT_LOGGED_IN;
+		else
+			rv = gck_attribute_get_string (attr, &label);
 		if (rv != CKR_OK)
 			gck_transaction_fail (transaction, rv);
 		else



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