port 80 keyserver access (was Re: GPG Recipients List)

Todd Freedom_Lover at pobox.com
Fri Dec 5 16:39:24 CET 2003


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

David Shaw wrote:
> Hmm.  I get the same, but I can retrieve the key by telnetting to
> port 80.  I suspect the problem is that GnuPG's HTTP handler does
> not provide the "Host:" header and keys.se.linux.org is a virtual
> host.

Just for fun (and to avoid shoveling snow for a few more minutes) I
patched gnupg and tested it, sans any proxy.  It did indeed retrieve
Jason's key properly.

So, what else has to be done other than this to make things work?

- --- gnupg-1.2.3/util/http.c~	Wed Jul 30 11:38:40 2003
+++ gnupg-1.2.3/util/http.c	Fri Dec  5 16:25:33 2003
@@ -506,18 +506,18 @@
     p = build_rel_path( hd->uri );
     request = m_alloc( strlen(server) + strlen(p) + 50 );
     if( http_proxy ) {
- -	sprintf( request, "%s http://%s:%hu%s%s HTTP/1.0\r\n",
+	sprintf( request, "%s http://%s:%hu%s%s HTTP/1.1\r\nHost: %s\r\n",
 			  hd->req_type == HTTP_REQ_GET ? "GET" :
 			  hd->req_type == HTTP_REQ_HEAD? "HEAD":
 			  hd->req_type == HTTP_REQ_POST? "POST": "OOPS",
- -			  server, port,  *p == '/'? "":"/", p );
+			  server, port,  *p == '/'? "":"/", p, server );
     }
     else {
- -	sprintf( request, "%s %s%s HTTP/1.0\r\n",
+	sprintf( request, "%s %s%s HTTP/1.1\r\nHost: %s\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 );
+					*p == '/'? "":"/", p, server );
     }
     m_free(p);
 
- -- 
Todd        OpenPGP -> KeyID: 0xD654075A | URL: www.pobox.com/~tmz/pgp
======================================================================
I honor and express all facets of my being, regardless of federal,
state and local laws.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)
Comment: When crypto is outlawed bayl bhgynjf jvyy unir cevinpl.

iD8DBQE/0PsMuv+09NZUB1oRAqSEAKCeTS0fZ6Rf+IOAHOTuPIZZug6UBACgs+W2
Ivdj95JuTT0YXs/bzr+8BGo=
=l1gn
-----END PGP SIGNATURE-----



More information about the Gnupg-users mailing list