summaryrefslogtreecommitdiffstats
path: root/g10
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2008-04-07 21:31:12 +0200
committerWerner Koch <wk@gnupg.org>2008-04-07 21:31:12 +0200
commit86f35a55d01f1ef7aec2b303a722ff5733148aa4 (patch)
tree99cb8163a8db0deba06608fec178ea9ad602e5c0 /g10
parentFixed last yat2m change. (diff)
downloadgnupg2-86f35a55d01f1ef7aec2b303a722ff5733148aa4.tar.xz
gnupg2-86f35a55d01f1ef7aec2b303a722ff5733148aa4.zip
Minor cleanups.
Implemented key helper kdns
Diffstat (limited to 'g10')
-rw-r--r--g10/ChangeLog6
-rw-r--r--g10/getkey.c8
-rw-r--r--g10/keyserver.c10
-rw-r--r--g10/pkclist.c1
4 files changed, 18 insertions, 7 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index b4f2720b3..f8f22256a 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-07 Werner Koch <wk@g10code.com>
+
+ * keyserver.c (parse_keyserver_uri): Allow a default host name.
+
+ * getkey.c (get_pubkey_byname): Replace sprintf by bin2hex.
+
2008-04-02 Werner Koch <wk@g10code.com>
* gpg.c (main): Do not allow DSA2 with a too old Libgcrypt.
diff --git a/g10/getkey.c b/g10/getkey.c
index c1d21f109..47cf22ea3 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -1012,9 +1012,8 @@ get_pubkey_byname (PKT_public_key *pk,
requirement as the URL might point to a key put in by an
attacker. By forcing the use of the fingerprint, we
won't use the attacker's key here. */
- if(rc==0 && fpr)
+ if (!rc && fpr)
{
- int i;
char fpr_string[MAX_FINGERPRINT_LEN*2+1];
assert(fpr_len<=MAX_FINGERPRINT_LEN);
@@ -1022,9 +1021,8 @@ get_pubkey_byname (PKT_public_key *pk,
free_strlist(namelist);
namelist=NULL;
- for(i=0;i<fpr_len;i++)
- sprintf(fpr_string+2*i,"%02X",fpr[i]);
-
+ bin2hex (fpr, fpr_len, fpr_string);
+
if(opt.verbose)
log_info("auto-key-locate found fingerprint %s\n",fpr_string);
diff --git a/g10/keyserver.c b/g10/keyserver.c
index 9a4e08483..12be4c2f0 100644
--- a/g10/keyserver.c
+++ b/g10/keyserver.c
@@ -330,7 +330,15 @@ parse_keyserver_uri(const char *string,int require_scheme,
keyserver->scheme=xstrdup("hkp");
}
- if(assume_hkp || (uri[0]=='/' && uri[1]=='/'))
+ if (uri[0]=='/' && uri[1]=='/' && uri[2] == '/')
+ {
+ /* Three slashes means network path with a default host name.
+ This is a hack because it does not crok all possible
+ combiantions. We should better repalce all code bythe parser
+ from http.c. */
+ keyserver->path = xstrdup (uri+2);
+ }
+ else if(assume_hkp || (uri[0]=='/' && uri[1]=='/'))
{
/* Two slashes means network path. */
diff --git a/g10/pkclist.c b/g10/pkclist.c
index 6b7401826..cb50ae29b 100644
--- a/g10/pkclist.c
+++ b/g10/pkclist.c
@@ -774,7 +774,6 @@ expand_group(strlist_t input)
Bit 1: This is a hidden recipient.
USE is the desired use for the key - usually PUBKEY_USAGE_ENC.
- RET_PK_LIST.
On success a list of keys is stored at the address RET_PK_LIST; the
caller must free this list. On error the value at this address is