keyserver sending problems (patch)

V. Alex Brennen vab at cryptnet.net
Fri May 4 23:24:01 CEST 2001


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Here's a quick fix until Werner can come up with something better....

- --- Begin Patch ---
diff -urN gnupg-1.0.5/g10/hkp.c gnupg-1.0.5.vab/g10/hkp.c
- --- gnupg-1.0.5/g10/hkp.c       Mon Apr 23 07:38:56 2001
+++ gnupg-1.0.5.vab/g10/hkp.c   Fri May  4 15:28:09 2001
@@ -173,7 +173,7 @@
        return rc;
     }

- -    sprintf( request, "Content-Length: %u\n",
+    sprintf( request, "Content-Length: %u\n\n",
                      (unsigned)iobuf_get_temp_length(temp) + 9 );
     iobuf_writestr( hd.fp_write, request );
     m_free( request );
diff -urN gnupg-1.0.5/util/http.c gnupg-1.0.5.vab/util/http.c
- --- gnupg-1.0.5/util/http.c     Sun Apr 29 09:28:03 2001
+++ gnupg-1.0.5.vab/util/http.c Fri May  4 15:27:24 2001
@@ -504,11 +504,20 @@
                          server, port,  *p == '/'? "":"/", p );
     }
     else {
- -       sprintf( request, "%s %s%s HTTP/1.0\r\n",
+        if(hd->req_type == HTTP_REQ_POST) {
+                sprintf( request, "%s %s%s HTTP/1.0",
                          hd->req_type == HTTP_REQ_GET ? "GET" :
                          hd->req_type == HTTP_REQ_HEAD? "HEAD":
                          hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
                                                  *p == '/'? "":"/", p );
+        }
+        else {
+               sprintf( request, "%s %s%s HTTP/1.0\r\n",
+                         hd->req_type == HTTP_REQ_GET ? "GET" :
+                         hd->req_type == HTTP_REQ_HEAD? "HEAD":
+                         hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
+                                                 *p == '/'? "":"/", p );
+        }
     }
     m_free(p);

- --- End Patch ---

Remember, you'll need to take out the escape '-'s that pgp will put in
the patch if you want to apply in the inline rather than the attached
patch.

	- VAB

- ---
V. Alex Brennen    [vab at cryptnet.net]
[http://www.cryptnet.net/people/vab/]
  F A R  B E Y O N D  D R I V E N !



On Fri, 4 May 2001, V. Alex Brennen wrote:

> On 4 May 2001, Josh Huber wrote:
>
> > Andrew McDonald <andrew at mcdonald.org.uk> writes:
> >
> > > I'm currently having problems with --send-key also. --recv-key is OK.
> > > This is using an unchanged copy of 1.0.5 (and also the Debian 1.0.5-1
> > > package).
> > >
> > > With --send-key I get the error:
> > > gpg: failed sending to `horowitz.surfnet.nl': status=400
> > > This does not depend on the keyserver I use. 1.0.4 works OK.
> > >
> > > Adding a -vvvv I also see:
> > > <HEAD><TITLE>400 Bad Request</TITLE></HEAD><BODY></BODY>
> > >
> > > I haven't delved any deeper at the moment.
> >
> > Yep, I'm having the same problem right now.  I can't --send-key with
> > any keyserver (that I've tried) with stock 1.0.5.
>
> Yeah,  looks like 1.05 has an extra line feed after the request header
> which is throwing off the keyservers. I'll see if I can't write a quick
> patch...
>
> 1.0.5:
>
> POST /pks/add HTTP/1.0
>
> Content-Length: 26040
> [keytext=url encoded ascii armored key]
>
>
> Should be (like 1.0.4):
>
> POST /pks/add HTTP/1.0
> Content-Length: 26040
>
> [keytext=url encoded ascii armored key]
>
>
> 		- VAB
>
> ---
> V. Alex Brennen    [vab at cryptnet.net]
> [http://www.cryptnet.net/people/vab/]
>   F A R  B E Y O N D  D R I V E N !
>
>
>
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
> ------------ Output from gpg ------------
> gpg: Signature made Fri 04 May 2001 03:03:28 PM EDT using DSA key ID 992A4B3F
> gpg: Good signature from "V. Alex Brennen (University of Florida) <alexb at ufl.edu>"
> gpg:                 aka "V. Alex Brennen <vab at cryptnet.net>"
> gpg:                 aka "V. Alex Brennen <vab at metanet.org>"
> gpg:                 aka "V. Alex Brennen (Children's Oncology Group, Research Data Center) <vab at cog.ufl.edu>"
> gpg:                 aka "V. Alex Brennen <vab at repsys.net>"
>
>

- -- 
- ---
V. Alex Brennen
Systems Programmer
UF COG RDC
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: Made with pgp4pine 1.75-6

iD8DBQE68wOz+pIJc5kqSz8RArAEAKCKNdY2FDuta5R9OQTjEEdwSil/ZACfaUI1
iCRxcCQEQfnGloQ1qhSytMU=
=1TuQ
-----END PGP SIGNATURE-----

-------------- next part --------------
diff -urN gnupg-1.0.5/g10/hkp.c gnupg-1.0.5.vab/g10/hkp.c
--- gnupg-1.0.5/g10/hkp.c	Mon Apr 23 07:38:56 2001
+++ gnupg-1.0.5.vab/g10/hkp.c	Fri May  4 15:28:09 2001
@@ -173,7 +173,7 @@
 	return rc;
     }
 
-    sprintf( request, "Content-Length: %u\n",
+    sprintf( request, "Content-Length: %u\n\n",
 		      (unsigned)iobuf_get_temp_length(temp) + 9 );
     iobuf_writestr( hd.fp_write, request );
     m_free( request );
diff -urN gnupg-1.0.5/util/http.c gnupg-1.0.5.vab/util/http.c
--- gnupg-1.0.5/util/http.c	Sun Apr 29 09:28:03 2001
+++ gnupg-1.0.5.vab/util/http.c	Fri May  4 15:27:24 2001
@@ -504,11 +504,20 @@
 			  server, port,  *p == '/'? "":"/", p );
     }
     else {
-	sprintf( request, "%s %s%s HTTP/1.0\r\n",
+        if(hd->req_type == HTTP_REQ_POST) {
+                sprintf( request, "%s %s%s HTTP/1.0",
 			  hd->req_type == HTTP_REQ_GET ? "GET" :
 			  hd->req_type == HTTP_REQ_HEAD? "HEAD":
 			  hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
 						  *p == '/'? "":"/", p );
+        }
+        else {
+	        sprintf( request, "%s %s%s HTTP/1.0\r\n",
+			  hd->req_type == HTTP_REQ_GET ? "GET" :
+			  hd->req_type == HTTP_REQ_HEAD? "HEAD":
+			  hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
+						  *p == '/'? "":"/", p );
+        }
     }
     m_free(p);
 


More information about the Gnupg-devel mailing list