~ubuntu-branches/ubuntu/raring/gnupg2/raring-updates

« back to all changes in this revision

Viewing changes to keyserver/gpgkeys_hkp.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2012-07-24 10:40:49 UTC
  • Revision ID: package-import@ubuntu.com-20120724104049-i45rcfa0ad2wl1g2
Tags: 2.0.17-2ubuntu3
* debian/patches/long-keyids.diff: Use the longest key ID available
  when requesting a key from a key server.
* debian/rules: don't generate config.guess, config.sub and version in
  clean target to prevent build cruft patches.
* debian/patches/debian-changes-2.0.17-2,
  debian/patches/debian-changes-2.0.17-2ubuntu1: removed, build cruft.

Show diffs side-by-side

added added

removed removed

Lines of Context:
241
241
get_key(char *getkey)
242
242
{
243
243
  CURLcode res;
244
 
  char request[MAX_URL+60];
 
244
  char request[MAX_URL+92];
245
245
  char *offset;
246
246
  struct curl_writer_ctx ctx;
 
247
  size_t keylen;
247
248
 
248
249
  memset(&ctx,0,sizeof(ctx));
249
250
 
269
270
  strcat(request,port);
270
271
  strcat(request,opt->path);
271
272
  /* request is MAX_URL+55 bytes long - MAX_URL covers the whole URL,
272
 
     including any supplied path.  The 60 overcovers this /pks/... etc
273
 
     string plus the 8 bytes of key id */
 
273
     including any supplied path.  The 92 overcovers this /pks/... etc
 
274
     string plus the 8, 16, or 40 bytes of key id/fingerprint */
274
275
  append_path(request,"/pks/lookup?op=get&options=mr&search=0x");
275
276
 
276
 
  /* fingerprint or long key id.  Take the last 8 characters and treat
277
 
     it like a short key id */
278
 
  if(strlen(getkey)>8)
279
 
    offset=&getkey[strlen(getkey)-8];
 
277
  /* send only fingerprint, long key id, or short keyid.  see:
 
278
     https://tools.ietf.org/html/draft-shaw-openpgp-hkp-00#section-3.1.1.1 */
 
279
  keylen = strlen(getkey);
 
280
  if(keylen >= 40)
 
281
    offset=&getkey[keylen-40];
 
282
  else if(keylen >= 16)
 
283
    offset=&getkey[keylen-16];
 
284
  else if(keylen >= 8)
 
285
    offset=&getkey[keylen-8];
280
286
  else
281
287
    offset=getkey;
282
288