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
This commit is contained in:
Ingo Klöcker 2022-08-18 10:43:19 +02:00
parent f2b48de26b
commit 2fa5c80aeb

View File

@ -136,7 +136,7 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int
strcmp(args, "keygen.flags") == 0) { strcmp(args, "keygen.flags") == 0) {
return FLAGS; return FLAGS;
} else if (status == GPGME_STATUS_GET_LINE && } else if (status == GPGME_STATUS_GET_LINE &&
strcmp(args, "keygen.keygrip")) { strcmp(args, "keygen.keygrip") == 0) {
err = NO_KEY_ERROR; err = NO_KEY_ERROR;
return ERROR; return ERROR;
} }
@ -157,7 +157,7 @@ unsigned int GpgAddExistingSubkeyEditInteractor::Private::nextState(unsigned int
strcmp(args, "keyedit.prompt") == 0) { strcmp(args, "keyedit.prompt") == 0) {
return QUIT; return QUIT;
} else if (status == GPGME_STATUS_GET_LINE && } else if (status == GPGME_STATUS_GET_LINE &&
strcmp(args, "keygen.valid")) { strcmp(args, "keygen.valid") == 0) {
err = INV_TIME_ERROR; err = INV_TIME_ERROR;
return ERROR; return ERROR;
} }