gnome-keyring r1416 - in trunk: . common daemon/pkcs11



Author: nnielsen
Date: Sat Jan  3 19:23:59 2009
New Revision: 1416
URL: http://svn.gnome.org/viewvc/gnome-keyring?rev=1416&view=rev

Log:
	* daemon/pkcs11/gkr-pkcs11-daemon-session.c: Allow starting one operation
	on top of another by cancelling the first.

	* common/gkr-buffer.c: Use a default allocator when none present.


Modified:
   trunk/ChangeLog
   trunk/common/gkr-buffer.c
   trunk/daemon/pkcs11/gkr-pkcs11-daemon-session.c

Modified: trunk/common/gkr-buffer.c
==============================================================================
--- trunk/common/gkr-buffer.c	(original)
+++ trunk/common/gkr-buffer.c	Sat Jan  3 19:23:59 2009
@@ -460,6 +460,8 @@
 	
 	if (!allocator)
 		allocator = buffer->allocator;
+	if (!allocator)
+		allocator = DEFAULT_ALLOCATOR;
 	
 	if (!gkr_buffer_get_uint32 (buffer, offset, &offset, &len)) {
 		return 0;
@@ -527,6 +529,8 @@
 	
 	if (!allocator)
 		allocator = buffer->allocator;
+	if (!allocator)
+		allocator = DEFAULT_ALLOCATOR;
 	
 	/* First the number of environment variable lines */
 	if (!gkr_buffer_get_uint32 (buffer, offset, &offset, &n))

Modified: trunk/daemon/pkcs11/gkr-pkcs11-daemon-session.c
==============================================================================
--- trunk/daemon/pkcs11/gkr-pkcs11-daemon-session.c	(original)
+++ trunk/daemon/pkcs11/gkr-pkcs11-daemon-session.c	Sat Jan  3 19:23:59 2009
@@ -432,9 +432,6 @@
 	CK_BBOOL token;
 	CK_RV ret;
 	
-	if (sinfo->operation_type)
-		return CKR_OPERATION_ACTIVE;
-
 	if (!(attrs = read_attribute_array (req)))
 		return PROTOCOL_ERROR;
 
@@ -628,8 +625,11 @@
 	GArray *attrs;
 	gboolean all;
 	
-	if (sinfo->operation_type)
-		return CKR_OPERATION_ACTIVE;
+	/* Abandon any current operation */
+	if (sinfo->operation_type) {
+		finish_operation (sinfo);
+		g_assert (!sinfo->operation_type);
+	}
 	
 	if (!(attrs = read_attribute_array (req)))
 		return PROTOCOL_ERROR;
@@ -749,8 +749,11 @@
 	CK_MECHANISM mech;
 	CK_RV ret;
 	
-	if (sinfo->operation_type)
-		return CKR_OPERATION_ACTIVE;
+	/* Abandon any current operation */
+	if (sinfo->operation_type) {
+		finish_operation (sinfo);
+		g_assert (!sinfo->operation_type);
+	}
 
 	if (!read_mechanism (req, &mech))
 		return PROTOCOL_ERROR;
@@ -848,8 +851,11 @@
 	CK_MECHANISM mech;
 	CK_RV ret;
 	
-	if (sinfo->operation_type)
-		return CKR_OPERATION_ACTIVE;
+	/* Abandon any current operation */
+	if (sinfo->operation_type) {
+		finish_operation (sinfo);
+		g_assert (!sinfo->operation_type);
+	}
 
 	if (!read_mechanism (req, &mech))
 		return PROTOCOL_ERROR;
@@ -991,8 +997,11 @@
 	CK_MECHANISM mech;
 	CK_RV ret;
 	
-	if (sinfo->operation_type)
-		return CKR_OPERATION_ACTIVE;
+	/* Abandon any current operation */
+	if (sinfo->operation_type) {
+		finish_operation (sinfo);
+		g_assert (!sinfo->operation_type);
+	}
 
 	if (!read_mechanism (req, &mech))
 		return PROTOCOL_ERROR;
@@ -1113,8 +1122,11 @@
 	CK_MECHANISM mech;
 	CK_RV ret;
 	
-	if (sinfo->operation_type)
-		return CKR_OPERATION_ACTIVE;
+	/* Abandon any current operation */
+	if (sinfo->operation_type) {
+		finish_operation (sinfo);
+		g_assert (!sinfo->operation_type);
+	}
 
 	if (!read_mechanism (req, &mech))
 		return PROTOCOL_ERROR;



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