[svn] gpgme - r1431 - trunk/src

svn author wk cvs at cvs.gnupg.org
Tue Nov 17 14:06:05 CET 2009


Author: wk
Date: 2009-11-17 14:06:05 +0100 (Tue, 17 Nov 2009)
New Revision: 1431

Modified:
   trunk/src/ChangeLog
   trunk/src/engine-uiserver.c
   trunk/src/sign.c
Log:
Fixes for the UI server engine .


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2009-11-10 18:05:04 UTC (rev 1430)
+++ trunk/src/ChangeLog	2009-11-17 13:06:05 UTC (rev 1431)
@@ -1,3 +1,8 @@
+2009-11-13    <wk at g10code.com>
+
+	* sign.c (_gpgme_sign_status_handler): Handle SIG_CREATED_SEEN.
+	* engine-uiserver.c (uiserver_sign): Make sending SENDER optional.
+
 2009-11-10  Marcus Brinkmann  <marcus at g10code.de>
 
 	* op-support.c (_gpgme_op_reset): Instead of last change, only set

Modified: trunk/src/engine-uiserver.c
===================================================================
--- trunk/src/engine-uiserver.c	2009-11-10 18:05:04 UTC (rev 1430)
+++ trunk/src/engine-uiserver.c	2009-11-17 13:06:05 UTC (rev 1431)
@@ -1153,6 +1153,7 @@
   gpgme_error_t err = 0;
   const char *protocol;
   char *cmd;
+  gpgme_key_t key;
 
   if (!uiserver || !in || !out)
     return gpg_error (GPG_ERR_INV_VALUE);
@@ -1169,27 +1170,28 @@
 		(mode == GPGME_SIG_MODE_DETACH) ? " --detached" : "") < 0)
     return gpg_error_from_errno (errno);
 
-  {
-    gpgme_key_t key = gpgme_signers_enum (ctx, 0);
-    const char *s = NULL;
-
-    if (key && key->uids)
-      s = key->uids->email;
-    
-    if (s && strlen (s) < 80)
+  key = gpgme_signers_enum (ctx, 0);
+  if (key)
+    {
+      const char *s = NULL;
+      
+      if (key && key->uids)
+        s = key->uids->email;
+      
+      if (s && strlen (s) < 80)
+        {
+          char buf[100];
+          
+          strcpy (stpcpy (buf, "SENDER --info "), s);
+          err = uiserver_assuan_simple_command (uiserver->assuan_ctx, buf,
+                                                uiserver->status.fnc,
+                                                uiserver->status.fnc_value);
+        }
+      else
+        err = gpg_error (GPG_ERR_INV_VALUE);
+      gpgme_key_unref (key);
+      if (err) 
       {
-	char buf[100];
-	
-	strcpy (stpcpy (buf, "SENDER --info "), s);
-	err = uiserver_assuan_simple_command (uiserver->assuan_ctx, buf,
-					      uiserver->status.fnc,
-					      uiserver->status.fnc_value);
-      }
-    else
-      err = gpg_error (GPG_ERR_INV_VALUE);
-    gpgme_key_unref (key);
-    if (err) 
-      {
 	free (cmd);
 	return err;
       }

Modified: trunk/src/sign.c
===================================================================
--- trunk/src/sign.c	2009-11-10 18:05:04 UTC (rev 1430)
+++ trunk/src/sign.c	2009-11-17 13:06:05 UTC (rev 1431)
@@ -286,9 +286,13 @@
       break;
 
     case GPGME_STATUS_EOF:
+      /* The UI server does not send information about the created
+         signature.  This is irrelevant for this protocol and thus we
+         should not check for that.  */
       if (opd->result.invalid_signers)
 	err = gpg_error (GPG_ERR_UNUSABLE_SECKEY);
-      else if (!opd->sig_created_seen)
+      else if (!opd->sig_created_seen
+               && ctx->protocol != GPGME_PROTOCOL_UISERVER)
 	err = gpg_error (GPG_ERR_GENERAL);
       break;
 




More information about the Gnupg-commits mailing list