From fa5f1b57cc12f9305d112f11c2c2d95751ed1a25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Tue, 4 Jan 2022 09:56:46 +0100 Subject: [PATCH] cpp: Remove obsolete workaround * lang/cpp/src/context.cpp (Context::startKeyListing, Context::exportPublicKeys, Context::startPublicKeyExport): Remove workaround. -- gpgme_op_keylist_ext[_start] supports GPGME_KEYLIST_MODE_EXTERN since a long time. And the export doesn't use a keylisting (anymore), so that the keylisting mode is irrelevant for the export. GnuPG-bug-id: 5757 --- lang/cpp/src/context.cpp | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/lang/cpp/src/context.cpp b/lang/cpp/src/context.cpp index a46aa6d3..d01f9453 100644 --- a/lang/cpp/src/context.cpp +++ b/lang/cpp/src/context.cpp @@ -528,12 +528,6 @@ Error Context::startKeyListing(const char *pattern, bool secretOnly) Error Context::startKeyListing(const char *patterns[], bool secretOnly) { d->lastop = Private::KeyList; -#ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN - if (!patterns || !patterns[0] || !patterns[1]) { - // max. one pattern -> use the non-ext version - return startKeyListing(patterns ? patterns[0] : nullptr, secretOnly); - } -#endif return Error(d->lasterr = gpgme_op_keylist_ext_start(d->ctx, patterns, int(secretOnly), 0)); } @@ -598,12 +592,6 @@ Error Context::exportPublicKeys(const char *pattern, Data &keyData, unsigned int Error Context::exportPublicKeys(const char *patterns[], Data &keyData, unsigned int flags) { d->lastop = Private::Export; -#ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN - if (!patterns || !patterns[0] || !patterns[1]) { - // max. one pattern -> use the non-ext version - return exportPublicKeys(patterns ? patterns[0] : nullptr, keyData, flags); - } -#endif Data::Private *const dp = keyData.impl(); return Error(d->lasterr = gpgme_op_export_ext(d->ctx, patterns, flags, dp ? dp->data : nullptr)); } @@ -618,12 +606,6 @@ Error Context::startPublicKeyExport(const char *pattern, Data &keyData, unsigned Error Context::startPublicKeyExport(const char *patterns[], Data &keyData, unsigned int flags) { d->lastop = Private::Export; -#ifndef HAVE_GPGME_EXT_KEYLIST_MODE_EXTERNAL_NONBROKEN - if (!patterns || !patterns[0] || !patterns[1]) { - // max. one pattern -> use the non-ext version - return startPublicKeyExport(patterns ? patterns[0] : nullptr, keyData, flags); - } -#endif Data::Private *const dp = keyData.impl(); return Error(d->lasterr = gpgme_op_export_ext_start(d->ctx, patterns, flags, dp ? dp->data : nullptr)); }