~ubuntu-branches/ubuntu/natty/gnupg2/natty-security

« back to all changes in this revision

Viewing changes to agent/minip12.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Urlichs
  • Date: 2005-12-08 22:13:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051208221321-4rvs2vu835iam5wv
Tags: 1.9.19-2
* Convert debian/changelog to UTF-8.
* Put gnupg-agent and gpgsm lintian overrides in the respectively
  right package.  Closes: #335066
* Added debhelper tokens to maintainer scripts.
* xsession fixes:
  o Added host name to gpg-agent PID file name.  Closes: #312717
  o Fixed xsession script to be able to run under zsh.  Closes: #308516
  o Don't run gpg-agent if one is already running.  Closes: #336480
* debian/control:
  o Fixed package description of gpgsm package.  Closes: #299842
  o Added mention of gpg-agent to description of gnupg-agent package.
    Closes: #304355
* Thanks to Peter Eisentraut <petere@debian.org> for all of the above.

Show diffs side-by-side

added added

removed removed

Lines of Context:
486
486
  buffer = p = plain;
487
487
 
488
488
/*   { */
 
489
/* #  warning debug code is enabled */
489
490
/*     FILE *fp = fopen ("tmp-rc2-plain.der", "wb"); */
490
491
/*     if (!fp || fwrite (p, n, 1, fp) != 1) */
491
492
/*       exit (2); */
586
587
        }
587
588
 
588
589
      /* Ugly hack to cope with the padding: Forget about the rest if
589
 
         that it is less than the cipher's block length. */
590
 
      if (n < 8)
 
590
         that is less or equal to the cipher's block length.  We can
 
591
         reasonable assume that all valid data will be longer than
 
592
         just one block. */
 
593
      if (n <= 8)
591
594
        n = 0;  
592
595
 
593
596
      /* Skip the optional SET with the pkcs12 cert attributes. */
602
605
            { /* The optional SET. */
603
606
              p += ti.length;
604
607
              n -= ti.length;
605
 
              if (n < 8)
 
608
              if (n <= 8)
606
609
                n = 0;
607
610
              if (n && parse_tag (&p, &n, &ti))
608
611
                goto bailout;
1082
1085
  /* Ready. */
1083
1086
  resultlen = p - result;
1084
1087
  if (needed != resultlen)
1085
 
    log_debug ("length mismatch: %u, %u\n", needed, resultlen);
 
1088
    log_debug ("length mismatch: %lu, %lu\n",
 
1089
               (unsigned long)needed, (unsigned long)resultlen);
1086
1090
 
1087
1091
  *r_length = resultlen;
1088
1092
  return result;
1336
1340
  keybaglen = p - keybag;
1337
1341
  
1338
1342
  if (needed != keybaglen)
1339
 
    log_debug ("length mismatch: %u, %u\n", needed, keybaglen);
 
1343
    log_debug ("length mismatch: %lu, %lu\n",
 
1344
               (unsigned long)needed, (unsigned long)keybaglen);
1340
1345
  
1341
1346
  *r_length = keybaglen;
1342
1347
  return keybag;
1428
1433
  p += DIM (data_rc2iter2048);
1429
1434
 
1430
1435
  /* 8. And finally the [0] tag with the encrypted data. */
1431
 
  p = store_tag_length (p, 0xa0, buflen);
 
1436
  p = store_tag_length (p, 0x80, buflen);
1432
1437
  memcpy (p, buffer, buflen);
1433
1438
  p += buflen;
1434
1439
  certbaglen = p - certbag;
1435
1440
  
1436
1441
  if (needed != certbaglen)
1437
 
    log_debug ("length mismatch: %u, %u\n", needed, certbaglen);
 
1442
    log_debug ("length mismatch: %lu, %lu\n",
 
1443
               (unsigned long)needed, (unsigned long)certbaglen);
1438
1444
 
1439
1445
  *r_length = certbaglen;
1440
1446
  return certbag;
1524
1530
  certseqlen = p - certseq;
1525
1531
  
1526
1532
  if (needed != certseqlen)
1527
 
    log_debug ("length mismatch: %u, %u\n", needed, certseqlen);
 
1533
    log_debug ("length mismatch: %lu, %lu\n",
 
1534
               (unsigned long)needed, (unsigned long)certseqlen);
1528
1535
  
1529
1536
  /* Append some pad characters; we already allocated extra space. */
1530
1537
  n = 8 - certseqlen % 8;
1546
1553
  unsigned char *buffer;
1547
1554
  size_t n, buflen;
1548
1555
  char salt[8];
1549
 
  struct buffer_s seqlist[2];
 
1556
  struct buffer_s seqlist[3];
1550
1557
  int seqlistidx = 0;
1551
1558
 
 
1559
  n = buflen = 0; /* (avoid compiler warning). */
 
1560
 
1552
1561
  if (cert && certlen)
1553
1562
    {
1554
1563
      /* Encode the certificate. */