1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
# Description: Use the longest key ID available when requesting a key from
4
# Origin: upstream, http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=commit;h=6fe25e5602fabe92c68e5ba30e4777221e8612df
5
# Bug: https://bugs.g10code.com/gnupg/issue1340
8
diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' gnupg-1.4.11~/keyserver/gpgkeys_hkp.c gnupg-1.4.11/keyserver/gpgkeys_hkp.c
9
--- gnupg-1.4.11~/keyserver/gpgkeys_hkp.c 2009-08-25 14:41:27.000000000 -0400
10
+++ gnupg-1.4.11/keyserver/gpgkeys_hkp.c 2012-07-24 10:28:34.399282804 -0400
15
- char request[MAX_URL+60];
16
+ char request[MAX_URL+92];
18
struct curl_writer_ctx ctx;
21
memset(&ctx,0,sizeof(ctx));
25
strcat(request,opt->path);
26
/* request is MAX_URL+55 bytes long - MAX_URL covers the whole URL,
27
- including any supplied path. The 60 overcovers this /pks/... etc
28
- string plus the 8 bytes of key id */
29
+ including any supplied path. The 92 overcovers this /pks/... etc
30
+ string plus the 8, 16, or 40 bytes of key id/fingerprint */
31
append_path(request,"/pks/lookup?op=get&options=mr&search=0x");
33
- /* fingerprint or long key id. Take the last 8 characters and treat
34
- it like a short key id */
35
- if(strlen(getkey)>8)
36
- offset=&getkey[strlen(getkey)-8];
37
+ /* send only fingerprint, long key id, or short keyid. see:
38
+ https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-3.1.1.1 */
39
+ keylen = strlen(getkey);
41
+ offset=&getkey[keylen-40];
42
+ else if(keylen >= 16)
43
+ offset=&getkey[keylen-16];
44
+ else if(keylen >= 8)
45
+ offset=&getkey[keylen-8];