From 8a1bd087fcc7bfcbaa389ae475708d1e2c7b9fcc Mon Sep 17 00:00:00 2001 From: David Shaw Date: Tue, 21 Feb 2006 05:20:08 +0000 Subject: [PATCH] * keyserver.c (parse_keyserver_uri): Include the scheme in the uri even when we've assumed "hkp" when there was no scheme. --- g10/ChangeLog | 5 +++++ g10/keyserver.c | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/g10/ChangeLog b/g10/ChangeLog index 50336b61d..5b6abd31d 100644 --- a/g10/ChangeLog +++ b/g10/ChangeLog @@ -1,3 +1,8 @@ +2006-02-20 David Shaw + + * keyserver.c (parse_keyserver_uri): Include the scheme in the uri + even when we've assumed "hkp" when there was no scheme. + 2006-02-14 Werner Koch * verify.c (verify_signatures): Print warning also for NO_DATA. diff --git a/g10/keyserver.c b/g10/keyserver.c index 6c5514487..af65ad365 100644 --- a/g10/keyserver.c +++ b/g10/keyserver.c @@ -215,8 +215,6 @@ parse_keyserver_uri(const char *uri,int require_scheme, keyserver=xmalloc_clear(sizeof(struct keyserver_spec)); - keyserver->uri=xstrdup(uri); - /* Get the scheme */ for(idx=uri,count=0;*idx && *idx!=':';idx++) @@ -247,11 +245,18 @@ parse_keyserver_uri(const char *uri,int require_scheme, /* Assume HKP if there is no scheme */ assume_hkp=1; keyserver->scheme=xstrdup("hkp"); + + keyserver->uri=xmalloc(strlen(keyserver->scheme)+3+strlen(uri)+1); + strcpy(keyserver->uri,keyserver->scheme); + strcat(keyserver->uri,"://"); + strcat(keyserver->uri,uri); } else { int i; + keyserver->uri=xstrdup(uri); + keyserver->scheme=xmalloc(count+1); /* Force to lowercase */