[git] GnuPG - branch, STABLE-BRANCH-1-4, updated. gnupg-1.4.11-25-g6fe25e5

by David Shaw cvs at cvs.gnupg.org
Wed Dec 28 23:38:34 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, STABLE-BRANCH-1-4 has been updated
       via  6fe25e5602fabe92c68e5ba30e4777221e8612df (commit)
      from  120b0ce1362a3d77955c10a0374d6cc99e885c86 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 6fe25e5602fabe92c68e5ba30e4777221e8612df
Author: David Shaw <dshaw at jabberwocky.com>
Date:   Wed Dec 28 16:41:31 2011 -0500

    Use the longest key ID available when talking to a HKP server.
    
    This is issue 1340.  Now that PKSD is dead, and SKS supports long key
    IDs, this is safe to do.  Patch from Daniel Kahn Gillmor
    <dkg at fifthhorseman.net>.

diff --git a/keyserver/gpgkeys_hkp.c b/keyserver/gpgkeys_hkp.c
index ae520fb..b2e1a1a 100644
--- a/keyserver/gpgkeys_hkp.c
+++ b/keyserver/gpgkeys_hkp.c
@@ -234,9 +234,10 @@ static int
 get_key(char *getkey)
 {
   CURLcode res;
-  char request[MAX_URL+60];
+  char request[MAX_URL+92];
   char *offset;
   struct curl_writer_ctx ctx;
+  size_t keylen;
 
   memset(&ctx,0,sizeof(ctx));
 
@@ -262,14 +263,19 @@ get_key(char *getkey)
   strcat(request,port);
   strcat(request,opt->path);
   /* request is MAX_URL+55 bytes long - MAX_URL covers the whole URL,
-     including any supplied path.  The 60 overcovers this /pks/... etc
-     string plus the 8 bytes of key id */
+     including any supplied path.  The 92 overcovers this /pks/... etc
+     string plus the 8, 16, or 40 bytes of key id/fingerprint */
   append_path(request,"/pks/lookup?op=get&options=mr&search=0x");
 
-  /* fingerprint or long key id.  Take the last 8 characters and treat
-     it like a short key id */
-  if(strlen(getkey)>8)
-    offset=&getkey[strlen(getkey)-8];
+  /* send only fingerprint, long key id, or short keyid.  see:
+     https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-3.1.1.1 */
+  keylen = strlen(getkey);
+  if(keylen >= 40)
+    offset=&getkey[keylen-40];
+  else if(keylen >= 16)
+    offset=&getkey[keylen-16];
+  else if(keylen >= 8)
+    offset=&getkey[keylen-8];
   else
     offset=getkey;
 

-----------------------------------------------------------------------

Summary of changes:
 keyserver/gpgkeys_hkp.c |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list