Index: gnupg-1.4.0.patched/keyserver/gpgkeys_hkp.c =================================================================== --- gnupg-1.4.0.patched/keyserver/gpgkeys_hkp.c +++ gnupg-1.4.0.patched/keyserver/gpgkeys_hkp.c @@ -44,7 +44,7 @@ static int verbose=0,include_revoked=0,include_disabled=0; static unsigned int http_flags=0; -static char host[80]={'\0'},proxy[80]={'\0'},port[10]={'\0'}; +static char host[80]={'\0'},proxy[80]={'\0'},port[10]={'\0'},path[1024]={'\0'}; static FILE *input=NULL,*output=NULL,*console=NULL; #define BEGIN "-----BEGIN PGP PUBLIC KEY BLOCK-----" @@ -101,7 +101,7 @@ memset(&hd,0,sizeof(hd)); - request=malloc(strlen(host)+100); + request=malloc(3+3+strlen(host)+1+strlen(port)+strlen(path)+100); if(!request) { fprintf(console,"gpgkeys: out of memory\n"); @@ -153,7 +153,8 @@ iobuf_flush_temp(temp); - sprintf(request,"hkp://%s%s%s/pks/add",host,port[0]?":":"",port[0]?port:""); + sprintf(request,"hkp://%s%s%s%s/pks/add", + host,port[0]?":":"",port[0]?port:"",path); if(verbose>2) fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request); @@ -249,15 +250,15 @@ fprintf(output,"KEY 0x%s BEGIN\n",getkey); - request=malloc(strlen(host)+100); + request=malloc(3+3+strlen(host)+1+strlen(port)+strlen(path)+100+strlen(search)); if(!request) { fprintf(console,"gpgkeys: out of memory\n"); return KEYSERVER_NO_MEMORY; } - sprintf(request,"hkp://%s%s%s/pks/lookup?op=get&options=mr&search=%s", - host,port[0]?":":"",port[0]?port:"", search); + sprintf(request,"hkp://%s%s%s%s/pks/lookup?op=get&options=mr&search=%s", + host,port[0]?":":"",port[0]?port:"",path,search); if(verbose>2) fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request); @@ -670,7 +671,7 @@ search[len]='\0'; - request=malloc(strlen(host)+100+strlen(search)); + request=malloc(3+3+strlen(host)+1+strlen(port)+strlen(path)+100+strlen(search)); if(!request) { fprintf(console,"gpgkeys: out of memory\n"); @@ -678,8 +679,8 @@ goto fail; } - sprintf(request,"hkp://%s%s%s/pks/lookup?op=index&options=mr&search=%s", - host,port[0]?":":"",port[0]?port:"",search); + sprintf(request,"hkp://%s%s%s%s/pks/lookup?op=index&options=mr&search=%s", + host,port[0]?":":"",port[0]?port:"",path,search); if(verbose>2) fprintf(console,"gpgkeys: HTTP URL is `%s'\n",request); @@ -867,6 +868,12 @@ continue; } + if(sscanf(line,"PATH %1023s\n",path)==1) + { + path[1023]='\0'; + continue; + } + if(sscanf(line,"VERSION %d\n",&version)==1) { if(version!=KEYSERVER_PROTO_VERSION) @@ -1029,6 +1036,8 @@ fprintf(console,"Host:\t\t%s\n",host); if(port[0]) fprintf(console,"Port:\t\t%s\n",port); + if(path[0]) + fprintf(console,"Path:\t\t%s\n",path); fprintf(console,"Command:\t%s\n",action==GET?"GET": action==SEND?"SEND":"SEARCH"); }