aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2006-01-16 17:59:46 +0000
committerDavid Shaw <[email protected]>2006-01-16 17:59:46 +0000
commit2c4b5d5de9608a06f68a18509447bbfc56ecf44f (patch)
tree4f426c618a1fc6320aff08cc15c4b303529fc5d1
parent* keyserver.c (keyserver_refresh): Fix problem when more than one key (diff)
downloadgnupg-2c4b5d5de9608a06f68a18509447bbfc56ecf44f.tar.gz
gnupg-2c4b5d5de9608a06f68a18509447bbfc56ecf44f.zip
* gpgkeys_hkp.c (send_key): Do not escape the '=' in the HTTP POST when
uploading a key.
Diffstat (limited to '')
-rw-r--r--keyserver/ChangeLog5
-rw-r--r--keyserver/gpgkeys_hkp.c29
2 files changed, 21 insertions, 13 deletions
diff --git a/keyserver/ChangeLog b/keyserver/ChangeLog
index beade08f1..815f5e302 100644
--- a/keyserver/ChangeLog
+++ b/keyserver/ChangeLog
@@ -1,3 +1,8 @@
+2006-01-16 David Shaw <[email protected]>
+
+ * gpgkeys_hkp.c (send_key): Do not escape the '=' in the HTTP POST
+ when uploading a key.
+
2005-12-23 David Shaw <[email protected]>
* ksutil.h, ksutil.c (parse_ks_options): New keyserver command
diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c
index 6d6ca518e..df03bc75b 100644
--- a/keyserver/gpgkeys_hkp.c
+++ b/keyserver/gpgkeys_hkp.c
@@ -88,18 +88,8 @@ send_key(int *eof)
int begin=0,end=0,ret=KEYSERVER_INTERNAL_ERROR;
char keyid[17];
char line[MAX_LINE];
- char *key,*encoded_key=NULL;
- size_t keylen=8,keymax=8;
-
- key=malloc(9);
- if(!key)
- {
- fprintf(console,"gpgkeys: out of memory\n");
- ret=KEYSERVER_NO_MEMORY;
- goto fail;
- }
-
- strcpy(key,"keytext=");
+ char *key=NULL,*encoded_key=NULL;
+ size_t keylen=0,keymax=0;
/* Read and throw away input until we see the BEGIN */
@@ -166,6 +156,19 @@ send_key(int *eof)
goto fail;
}
+ free(key);
+
+ key=malloc(8+strlen(encoded_key)+1);
+ if(!key)
+ {
+ fprintf(console,"gpgkeys: out of memory\n");
+ ret=KEYSERVER_NO_MEMORY;
+ goto fail;
+ }
+
+ strcpy(key,"keytext=");
+ strcat(key,encoded_key);
+
strcpy(request,"http://");
strcat(request,opt->host);
strcat(request,":");
@@ -183,7 +186,7 @@ send_key(int *eof)
curl_easy_setopt(curl,CURLOPT_URL,request);
curl_easy_setopt(curl,CURLOPT_POST,1);
- curl_easy_setopt(curl,CURLOPT_POSTFIELDS,encoded_key);
+ curl_easy_setopt(curl,CURLOPT_POSTFIELDS,key);
curl_easy_setopt(curl,CURLOPT_FAILONERROR,1);
res=curl_easy_perform(curl);