From 54314a9c7d7ad52981c836ca742644a1fa69b518 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Wed, 1 Jun 2016 13:46:27 +0200 Subject: [PATCH] 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 fb68bcb3..d2633b5f 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; } }