aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Klöcker <[email protected]>2022-12-08 14:27:22 +0000
committerIngo Klöcker <[email protected]>2022-12-08 14:31:37 +0000
commite7953dcf1376631719c73d9fa34bcb96752d3794 (patch)
tree9316995f309e933622ccbd322a74d81a962d75df
parentcpp: Handle statuses that need no response in the base edit interactor (diff)
downloadgpgme-e7953dcf1376631719c73d9fa34bcb96752d3794.tar.gz
gpgme-e7953dcf1376631719c73d9fa34bcb96752d3794.zip
cpp: Handle status errors in the base edit interactor
* lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl): Handle status errors. * lang/cpp/src/gpgrevokekeyeditinteractor.cpp (GpgRevokeKeyEditInteractor::Private::nextState): Remove handling of status errors. -- With this change status errors are handled for all interactors. In particular, this makes all edit interactors handle canceled password prompts correctly. GnuPG-bug-id: 6305
-rw-r--r--lang/cpp/src/editinteractor.cpp3
-rw-r--r--lang/cpp/src/gpgrevokekeyeditinteractor.cpp4
2 files changed, 3 insertions, 4 deletions
diff --git a/lang/cpp/src/editinteractor.cpp b/lang/cpp/src/editinteractor.cpp
index 707bf8b9..373a4464 100644
--- a/lang/cpp/src/editinteractor.cpp
+++ b/lang/cpp/src/editinteractor.cpp
@@ -99,6 +99,9 @@ public:
if (ei->q->needsNoResponse(status)) {
// keep state
+ } else if (status == GPGME_STATUS_ERROR) {
+ err = ei->q->parseStatusError(args);
+ ei->state = EditInteractor::ErrorState;
} else {
ei->state = ei->q->nextState(status, args, err);
}
diff --git a/lang/cpp/src/gpgrevokekeyeditinteractor.cpp b/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
index fd584099..fda70f24 100644
--- a/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
+++ b/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
@@ -112,10 +112,6 @@ unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status,
static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL);
- if (status == GPGME_STATUS_ERROR) {
- err = q->parseStatusError(args);
- return ERROR;
- }
switch (const auto state = q->state()) {
case START:
if (status == GPGME_STATUS_GET_LINE &&