1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-02 22:46:30 +02:00

gpg: Allow --locate-external-key even with --no-auto-key-locate.

* g10/getkey.c (akl_empty_or_only_local): New.
* g10/gpg.c (DEFAULT_AKL_LIST): New.
(main): Use it here.
(main) <aLocateExtKeys>: Set default AKL if none is set.
--

This better matches the expectations of the user.  The used list in
this case is the default list ("local,wkd") with local ignored by the
command anyway.

GnuPG-bug-id: 4662
Signed-off-by: Werner Koch <wk@gnupg.org>
(cherry picked from commit d058d80ed0)
This commit is contained in:
Werner Koch 2019-08-23 13:22:15 +02:00
parent 589f118713
commit df6cff8233
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
3 changed files with 35 additions and 1 deletions

View file

@ -4022,6 +4022,26 @@ release_akl (void)
}
}
/* Returns true if the AKL is empty or has only the local method
* active. */
int
akl_empty_or_only_local (void)
{
struct akl *akl;
int any = 0;
for (akl = opt.auto_key_locate; akl; akl = akl->next)
if (akl->type != AKL_NODEFAULT && akl->type != AKL_LOCAL)
{
any = 1;
break;
}
return !any;
}
/* Returns false on error. */
int
parse_auto_key_locate (const char *options_arg)