1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-18 00:49:50 +02:00

* gpgkeys_hkp.c (send_key): Do not escape the '=' in the HTTP POST when

uploading a key.
This commit is contained in:
David Shaw 2006-01-16 17:59:46 +00:00
parent 7b978efef8
commit 2c4b5d5de9
2 changed files with 21 additions and 13 deletions

View File

@ -1,3 +1,8 @@
2006-01-16 David Shaw <dshaw@jabberwocky.com>
* gpgkeys_hkp.c (send_key): Do not escape the '=' in the HTTP POST
when uploading a key.
2005-12-23 David Shaw <dshaw@jabberwocky.com>
* ksutil.h, ksutil.c (parse_ks_options): New keyserver command

View File

@ -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);