diff options
author | Ingo Klöcker <[email protected]> | 2022-08-18 08:43:19 +0000 |
---|---|---|
committer | Ingo Klöcker <[email protected]> | 2022-08-18 08:43:19 +0000 |
commit | 2fa5c80aeba4528b3bdf41ec5740e7db5d4b6d2b (patch) | |
tree | 1445d384089f19cff555bb0faddc4586097dac08 | |
parent | qt,tests: Make sure expiration time is interpreted as unsigned number (diff) | |
download | gpgme-2fa5c80aeba4528b3bdf41ec5740e7db5d4b6d2b.tar.gz gpgme-2fa5c80aeba4528b3bdf41ec5740e7db5d4b6d2b.zip |
cpp: Fix handling of "no key" or "invalid time" situations
* lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp
(GpgAddExistingSubkeyEditInteractor::Private::nextState): Fix inverted
logic of string comparisons.
--
This fixes the problem that the interactor didn't return the proper
error code if gpg didn't accept the key grip or the expiration date.
GnuPG-bug-id: 6137
-rw-r--r-- | lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp b/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp index 547e613d..8eec7460 100644 --- a/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp +++ b/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp @@ -136,7 +136,7 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int strcmp(args, "keygen.flags") == 0) { return FLAGS; } else if (status == GPGME_STATUS_GET_LINE && - strcmp(args, "keygen.keygrip")) { + strcmp(args, "keygen.keygrip") == 0) { err = NO_KEY_ERROR; return ERROR; } @@ -157,7 +157,7 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int strcmp(args, "keyedit.prompt") == 0) { return QUIT; } else if (status == GPGME_STATUS_GET_LINE && - strcmp(args, "keygen.valid")) { + strcmp(args, "keygen.valid") == 0) { err = INV_TIME_ERROR; return ERROR; } |