summaryrefslogtreecommitdiffstats
path: root/g10/keyedit.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2019-07-04 10:42:48 +0200
committerWerner Koch <wk@gnupg.org>2019-07-04 10:42:48 +0200
commit9980f81da765f88a65604ab083563bf15ccdb425 (patch)
treef38f4a030de35bedcbda0c7983216622125e4444 /g10/keyedit.c
parentdirmngr: Avoid endless loop in case of HTTP error 503. (diff)
downloadgnupg2-9980f81da765f88a65604ab083563bf15ccdb425.tar.xz
gnupg2-9980f81da765f88a65604ab083563bf15ccdb425.zip
gpg: Make the get_pubkey_byname interface easier to understand.
* g10/keydb.h (enum get_pubkey_modes): New. * g10/getkey.c (get_pubkey_byname): Repalce no_akl by a mode arg and change all callers. -- This change prepares the implementation of GET_PUBKEY_NO_LOCAL. Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'g10/keyedit.c')
-rw-r--r--g10/keyedit.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/g10/keyedit.c b/g10/keyedit.c
index cb05914e1..1bf5de9b2 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -1438,7 +1438,8 @@ keyedit_menu (ctrl_t ctrl, const char *username, strlist_t locusr,
#endif
/* Get the public key */
- err = get_pubkey_byname (ctrl, NULL, NULL, username, &keyblock, &kdbhd, 1, 1);
+ err = get_pubkey_byname (ctrl, GET_PUBKEY_NO_AKL,
+ NULL, NULL, username, &keyblock, &kdbhd, 1);
if (err)
{
log_error (_("key \"%s\" not found: %s\n"), username, gpg_strerror (err));
@@ -2571,7 +2572,8 @@ find_by_primary_fpr (ctrl_t ctrl, const char *fpr,
err = gpg_error (GPG_ERR_INV_NAME);
goto leave;
}
- err = get_pubkey_byname (ctrl, NULL, NULL, fpr, &keyblock, &kdbhd, 1, 1);
+ err = get_pubkey_byname (ctrl, GET_PUBKEY_NO_AKL,
+ NULL, NULL, fpr, &keyblock, &kdbhd, 1);
if (err)
{
log_error (_("key \"%s\" not found: %s\n"), fpr, gpg_strerror (err));
@@ -4290,7 +4292,8 @@ menu_addrevoker (ctrl_t ctrl, kbnode_t pub_keyblock, int sensitive)
primary keys only, but some casual testing shows that PGP and
GnuPG both can handle a designated revocation from a subkey. */
revoker_pk->req_usage = PUBKEY_USAGE_CERT;
- rc = get_pubkey_byname (ctrl, NULL, revoker_pk, answer, NULL, NULL, 1, 1);
+ rc = get_pubkey_byname (ctrl, GET_PUBKEY_NO_AKL,
+ NULL, revoker_pk, answer, NULL, NULL, 1);
if (rc)
{
log_error (_("key \"%s\" not found: %s\n"), answer,