[git] GPA - branch, master, updated. gpa-0.9.9-5-gb9efe75

by Werner Koch cvs at cvs.gnupg.org
Fri May 20 16:34:43 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Assistant".

The branch, master has been updated
       via  b9efe75ab7addb2eecd8e2274ed8907b9f6a3712 (commit)
      from  ea99f888c0f557fdce3870bb021ac7c3dd84a12d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b9efe75ab7addb2eecd8e2274ed8907b9f6a3712
Author: Werner Koch <wk at gnupg.org>
Date:   Fri May 20 16:31:45 2016 +0200

    Make the gpgme edito FSM more robust.
    
    * src/gpgmeedit.c (edit_fnc): Whitelist instead of blacklisting needed
    status codes.
    --
    
    The old code broke every  time we added a new status code to gpg.
    This way it is MUCH more robust.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/src/gpgmeedit.c b/src/gpgmeedit.c
index 5f6768f..72b6832 100644
--- a/src/gpgmeedit.c
+++ b/src/gpgmeedit.c
@@ -211,26 +211,26 @@ edit_fnc (void *opaque, gpgme_status_code_t status,
   struct edit_parms_s *parms = opaque;
   char *result = NULL;
 
-  /* Ignore these status lines, as they don't require any response */
-  if (status == GPGME_STATUS_EOF
-      || status == GPGME_STATUS_GOT_IT
-      || status == GPGME_STATUS_NEED_PASSPHRASE
-      || status == GPGME_STATUS_NEED_PASSPHRASE_SYM
-      || status == GPGME_STATUS_GOOD_PASSPHRASE
-      || status == GPGME_STATUS_BAD_PASSPHRASE
-      || status == GPGME_STATUS_USERID_HINT
-      || status == GPGME_STATUS_SIGEXPIRED
-      || status == GPGME_STATUS_KEYEXPIRED
-      || status == GPGME_STATUS_BACKUP_KEY_CREATED
-      || status == GPGME_STATUS_CARDCTRL       /* Issued by gpg1.  */
-      || status == GPGME_STATUS_SC_OP_SUCCESS
-      || status == GPGME_STATUS_PINENTRY_LAUNCHED
-      || status == GPGME_STATUS_PROGRESS)
+  /* Whitelist all status code we know about.  */
+  switch (status)
     {
+    case GPGME_STATUS_ALREADY_SIGNED:
+    case GPGME_STATUS_ERROR:
+    case GPGME_STATUS_GET_BOOL:
+    case GPGME_STATUS_GET_LINE:
+    case GPGME_STATUS_KEY_CREATED:
+    case GPGME_STATUS_NEED_PASSPHRASE_SYM:
+    case GPGME_STATUS_SC_OP_FAILURE:
+      break;
+
+    default:
+      /* We don't know and thus do not need this status code.  */
       return parms->err;
     }
-  else if (!parms->need_status_passphrase_sym
-           && status == GPGME_STATUS_NEED_PASSPHRASE_SYM)
+
+
+  if (!parms->need_status_passphrase_sym
+      && status == GPGME_STATUS_NEED_PASSPHRASE_SYM)
     {
       return parms->err;
     }

-----------------------------------------------------------------------

Summary of changes:
 src/gpgmeedit.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Assistant
http://git.gnupg.org




More information about the Gnupg-commits mailing list