From 266e05eee859b83d97079c2fbbd2f1da010fa412 Mon Sep 17 00:00:00 2001 From: Andre Heinecke Date: Fri, 1 Nov 2019 12:02:07 +0100 Subject: [PATCH] cpp: Fix adding duplicated sigs on multiple uids * lang/cpp/src/gpgsignkeyeditinteractor.cpp: Add another state DUPE_OK2 to allow gpg looping over all uids. -- When duplicated signatures should be added to multiple user ids GnuPG will ask for each uid so we have to add a transition for that. GnuPG-Bug-Id: T4734 --- lang/cpp/src/gpgsignkeyeditinteractor.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lang/cpp/src/gpgsignkeyeditinteractor.cpp b/lang/cpp/src/gpgsignkeyeditinteractor.cpp index d43d2f90..80c5f122 100644 --- a/lang/cpp/src/gpgsignkeyeditinteractor.cpp +++ b/lang/cpp/src/gpgsignkeyeditinteractor.cpp @@ -162,6 +162,7 @@ enum SignKeyState { CONFIRM, CONFIRM2, DUPE_OK, + DUPE_OK2, QUIT, SAVE, ERROR = EditInteractor::ErrorState @@ -197,6 +198,7 @@ static GpgSignKeyEditInteractor_Private::TransitionMap makeTable() addEntry(SET_EXPIRE, GET_BOOL, "sign_uid.class", SET_CHECK_LEVEL); addEntry(CONFIRM, GET_BOOL, "sign_uid.local_promote_okay", CONFIRM); addEntry(DUPE_OK, GET_BOOL, "sign_uid.okay", CONFIRM); + addEntry(DUPE_OK2, GET_BOOL, "sign_uid.okay", CONFIRM); addEntry(CONFIRM, GET_BOOL, "sign_uid.okay", CONFIRM); addEntry(CONFIRM2, GET_BOOL, "sign_uid.okay", CONFIRM); addEntry(CONFIRM, GET_LINE, "keyedit.prompt", COMMAND); @@ -210,6 +212,8 @@ static GpgSignKeyEditInteractor_Private::TransitionMap makeTable() addEntry(UIDS_LIST_SEPARATELY_DONE, GET_LINE, "sign_uid.class", SET_CHECK_LEVEL); addEntry(UIDS_LIST_SEPARATELY_DONE, GET_BOOL, "sign_uid.okay", CONFIRM); addEntry(UIDS_LIST_SEPARATELY_DONE, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK); + addEntry(DUPE_OK, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK2); + addEntry(DUPE_OK2, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK); addEntry(CONFIRM, GET_LINE, "keyedit.prompt", QUIT); addEntry(ERROR, GET_LINE, "keyedit.prompt", QUIT); addEntry(QUIT, GET_BOOL, "keyedit.save.okay", SAVE); @@ -242,6 +246,7 @@ const char *GpgSignKeyEditInteractor::action(Error &err) const case SET_CHECK_LEVEL: return check_level_strings[d->checkLevel]; case DUPE_OK: + case DUPE_OK2: return answer(d->dupeOk); case CONFIRM2: case CONFIRM: