[svn] GnuPG - r3986 - trunk/keyserver
svn author dshaw
cvs at cvs.gnupg.org
Mon Jan 16 18:59:47 CET 2006
Author: dshaw
Date: 2006-01-16 18:59:46 +0100 (Mon, 16 Jan 2006)
New Revision: 3986
Modified:
trunk/keyserver/ChangeLog
trunk/keyserver/gpgkeys_hkp.c
Log:
* gpgkeys_hkp.c (send_key): Do not escape the '=' in the HTTP POST when
uploading a key.
Modified: trunk/keyserver/ChangeLog
===================================================================
--- trunk/keyserver/ChangeLog 2006-01-07 21:04:13 UTC (rev 3985)
+++ trunk/keyserver/ChangeLog 2006-01-16 17:59:46 UTC (rev 3986)
@@ -1,3 +1,8 @@
+2006-01-16 David Shaw <dshaw at 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 at jabberwocky.com>
* ksutil.h, ksutil.c (parse_ks_options): New keyserver command
Modified: trunk/keyserver/gpgkeys_hkp.c
===================================================================
--- trunk/keyserver/gpgkeys_hkp.c 2006-01-07 21:04:13 UTC (rev 3985)
+++ trunk/keyserver/gpgkeys_hkp.c 2006-01-16 17:59:46 UTC (rev 3986)
@@ -88,19 +88,9 @@
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;
+ char *key=NULL,*encoded_key=NULL;
+ size_t keylen=0,keymax=0;
- key=malloc(9);
- if(!key)
- {
- fprintf(console,"gpgkeys: out of memory\n");
- ret=KEYSERVER_NO_MEMORY;
- goto fail;
- }
-
- strcpy(key,"keytext=");
-
/* Read and throw away input until we see the BEGIN */
while(fgets(line,MAX_LINE,input)!=NULL)
@@ -166,6 +156,19 @@
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 @@
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);
More information about the Gnupg-commits
mailing list