aboutsummaryrefslogtreecommitdiffstats
path: root/g10/getkey.c
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2006-02-24 14:27:22 +0000
committerDavid Shaw <[email protected]>2006-02-24 14:27:22 +0000
commitf4f5ea43e76fff8941a8148e70f237b7c4033b41 (patch)
treec9bde0dd601fb120ca0b4b81ff279a318cb42b52 /g10/getkey.c
parent* keyserver.c (parse_keyserver_options): Only change max_cert if it is (diff)
downloadgnupg-f4f5ea43e76fff8941a8148e70f237b7c4033b41.tar.gz
gnupg-f4f5ea43e76fff8941a8148e70f237b7c4033b41.zip
* keydb.h, getkey.c (release_akl), gpg.c (main): Add
--no-auto-key-locate. * options.h, gpg.c (main): Keep track of each keyserver registered so we can match on them later. * keyserver-internal.h, keyserver.c (cmp_keyserver_spec, keyserver_match), gpgv.c: New. Find a keyserver that matches ours and return its spec. * getkey.c (get_pubkey_byname): Use it here to get the per-keyserver options from an earlier keyserver.
Diffstat (limited to 'g10/getkey.c')
-rw-r--r--g10/getkey.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/g10/getkey.c b/g10/getkey.c
index 81b15b2e2..6c64c77f8 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1,6 +1,6 @@
/* getkey.c - Get a key from the database
- * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
- * 2005 Free Software Foundation, Inc.
+ * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+ * 2006 Free Software Foundation, Inc.
*
* This file is part of GnuPG.
*
@@ -989,13 +989,18 @@ get_pubkey_byname (PKT_public_key *pk,
break;
case AKL_SPEC:
- glo_ctrl.in_auto_key_retrieve++;
- res=keyserver_import_name(name,akl->spec);
- glo_ctrl.in_auto_key_retrieve--;
+ {
+ struct keyserver_spec *keyserver;
- if(res==0)
- log_info(_("Automatically retrieved `%s' via %s\n"),
- name,akl->spec->uri);
+ keyserver=keyserver_match(akl->spec);
+ glo_ctrl.in_auto_key_retrieve++;
+ res=keyserver_import_name(name,keyserver);
+ glo_ctrl.in_auto_key_retrieve--;
+
+ if(res==0)
+ log_info(_("Automatically retrieved `%s' via %s\n"),
+ name,akl->spec->uri);
+ }
break;
}
@@ -2898,6 +2903,17 @@ free_akl(struct akl *akl)
xfree(akl);
}
+void
+release_akl(void)
+{
+ while(opt.auto_key_locate)
+ {
+ struct akl *akl2=opt.auto_key_locate;
+ opt.auto_key_locate=opt.auto_key_locate->next;
+ free_akl(akl2);
+ }
+}
+
int
parse_auto_key_locate(char *options)
{