core: Set --key-origin option only if supported by gpg

* src/engine-gpg.c (gpg_import): Do not pass --key-origin option to
gpg if gpg is too old.
--

GnuPG-bug-id: 5733
This commit is contained in:
Ingo Klöcker 2021-12-14 14:41:23 +01:00
parent fd6bec617d
commit fd680254da

View File

@ -2831,7 +2831,7 @@ gpg_import (void *engine, gpgme_data_t keydata, gpgme_key_t *keyarray,
else
{
err = add_arg (gpg, "--import");
if (!err && key_origin)
if (!err && key_origin && have_gpg_version (gpg, "2.1.22"))
{
err = add_arg (gpg, "--key-origin");
if (!err)