[Pkg-gnupg-commit] [gpgme] 152/412: Cpp: Use whitelist for status messages

Daniel Kahn Gillmor dkg at fifthhorseman.net
Thu Sep 22 21:26:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch master
in repository gpgme.

commit 54314a9c7d7ad52981c836ca742644a1fa69b518
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Jun 1 13:46:27 2016 +0200

    Cpp: Use whitelist for status messages
    
    * lang/cpp/src/editinteractor.cpp (EditInteractor::needsNoResponse):
    Use whitelist instead of blacklist.
    
    --
    This should be more robust when new status messages are added.
    The whitelist is the same GPA uses. Fixes Qt's t-ownertrust.
---
 lang/cpp/src/editinteractor.cpp | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/lang/cpp/src/editinteractor.cpp b/lang/cpp/src/editinteractor.cpp
index fb68bcb..d2633b5 100644
--- a/lang/cpp/src/editinteractor.cpp
+++ b/lang/cpp/src/editinteractor.cpp
@@ -201,20 +201,16 @@ Error EditInteractor::lastError() const
 bool EditInteractor::needsNoResponse(unsigned int status) const
 {
     switch (status) {
-    case GPGME_STATUS_EOF:
-    case GPGME_STATUS_GOT_IT:
-    case GPGME_STATUS_NEED_PASSPHRASE:
+    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_GOOD_PASSPHRASE:
-    case GPGME_STATUS_BAD_PASSPHRASE:
-    case GPGME_STATUS_USERID_HINT:
-    case GPGME_STATUS_SIGEXPIRED:
-    case GPGME_STATUS_KEYEXPIRED:
-    case GPGME_STATUS_PINENTRY_LAUNCHED:
-    case GPGME_STATUS_KEY_CONSIDERED:
-        return true;
-    default:
+    case GPGME_STATUS_SC_OP_FAILURE:
         return false;
+    default:
+        return true;
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list