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
This commit is contained in:
Ingo Klöcker 2022-01-04 09:56:46 +01:00
parent 0e19c48791
commit fa5f1b57cc

View File

@ -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));
}