summaryrefslogtreecommitdiffstats
path: root/g10/hkp.c
diff options
context:
space:
mode:
authorDavid Shaw <dshaw@jabberwocky.com>2002-07-09 21:40:18 +0200
committerDavid Shaw <dshaw@jabberwocky.com>2002-07-09 21:40:18 +0200
commit9ffea0d67b13d863f73578e25f533652e58136bf (patch)
tree831f490e40a68319b7514b19e46dd6f954495878 /g10/hkp.c
parent* gpgkeys_mailto.in: Use new OPAQUE tag for non net-path URIs. Fail more (diff)
downloadgnupg2-9ffea0d67b13d863f73578e25f533652e58136bf.tar.xz
gnupg2-9ffea0d67b13d863f73578e25f533652e58136bf.zip
* options.h, keyserver.c (parse_keyserver_uri, keyserver_spawn,
keyserver_work), hkp.c (hkp_ask_import, hkp_export, hkp_search): Use a much more strict reading of RFC-2396 for the keyserver URIs. Specifically, don't try and be smart about checking the value of ":port" so long as it is all digits, and properly handle opaque data (those scheme specific parts that do not start with "//").
Diffstat (limited to 'g10/hkp.c')
-rw-r--r--g10/hkp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/g10/hkp.c b/g10/hkp.c
index 4cfb2bf10..1d4baaf47 100644
--- a/g10/hkp.c
+++ b/g10/hkp.c
@@ -84,8 +84,8 @@ hkp_ask_import( KEYDB_SEARCH_DESC *desc, void *stats_handle)
sprintf(request,"x-hkp://%s%s%s/pks/lookup?op=get&search=0x%08lX",
opt.keyserver_host,
- atoi(opt.keyserver_port)>0?":":"",
- atoi(opt.keyserver_port)>0?opt.keyserver_port:"",
+ opt.keyserver_port?":":"",
+ opt.keyserver_port?opt.keyserver_port:"",
(ulong)key[1] );
if(opt.keyserver_options.verbose>2)
@@ -138,8 +138,8 @@ hkp_export( STRLIST users )
sprintf( request, "x-hkp://%s%s%s/pks/add",
opt.keyserver_host,
- atoi(opt.keyserver_port)>0?":":"",
- atoi(opt.keyserver_port)>0?opt.keyserver_port:"");
+ opt.keyserver_port?":":"",
+ opt.keyserver_port?opt.keyserver_port:"");
if(opt.keyserver_options.verbose>2)
log_info("request is \"%s\"\n",request);
@@ -532,8 +532,8 @@ int hkp_search(STRLIST tokens)
sprintf(request,"x-hkp://%s%s%s/pks/lookup?op=index&search=%s",
opt.keyserver_host,
- atoi(opt.keyserver_port)>0?":":"",
- atoi(opt.keyserver_port)>0?opt.keyserver_port:"",
+ opt.keyserver_port?":":"",
+ opt.keyserver_port?opt.keyserver_port:"",
searchurl);
if(opt.keyserver_options.verbose>2)