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

« back to all changes in this revision

Viewing changes to scd/app-nks.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:
117
117
 
118
118
 
119
119
 
120
 
static int
 
120
static gpg_error_t
121
121
do_learn_status (APP app, CTRL ctrl)
122
122
{
123
123
  gpg_error_t err;
175
175
   the CERTINFO status lines) and return it in the freshly allocated
176
176
   buffer put into CERT and the length of the certificate put into
177
177
   CERTLEN. */
178
 
static int
 
178
static gpg_error_t
179
179
do_readcert (app_t app, const char *certid,
180
180
             unsigned char **cert, size_t *certlen)
181
181
{
299
299
 
300
300
 
301
301
/* Verify the PIN if required.  */
302
 
static int
 
302
static gpg_error_t
303
303
verify_pin (app_t app,
304
 
            int (pincb)(void*, const char *, char **),
 
304
            gpg_error_t (*pincb)(void*, const char *, char **),
305
305
            void *pincb_arg)
306
306
{
307
307
  /* Note that force_chv1 is never set but we do it here anyway so
308
 
     that other applications may euse this function.  For example it
 
308
     that other applications may reuse this function.  For example it
309
309
     makes sense to set force_chv1 for German signature law cards.
310
310
     NKS is very similar to the DINSIG draft standard. */
311
311
  if (!app->did_chv1 || app->force_chv1 ) 
357
357
   If a PIN is required the PINCB will be used to ask for the PIN;
358
358
   that callback should return the PIN in an allocated buffer and
359
359
   store that in the 3rd argument.  */
360
 
static int 
 
360
static gpg_error_t 
361
361
do_sign (app_t app, const char *keyidstr, int hashalgo,
362
 
         int (pincb)(void*, const char *, char **),
363
 
           void *pincb_arg,
364
 
           const void *indata, size_t indatalen,
365
 
           unsigned char **outdata, size_t *outdatalen )
 
362
         gpg_error_t (*pincb)(void*, const char *, char **),
 
363
         void *pincb_arg,
 
364
         const void *indata, size_t indatalen,
 
365
         unsigned char **outdata, size_t *outdatalen )
366
366
{
367
367
  static unsigned char sha1_prefix[15] = /* Object ID is 1.3.14.3.2.26 */
368
368
    { 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03,
435
435
/* Decrypt the data in INDATA and return the allocated result in OUTDATA.
436
436
   If a PIN is required the PINCB will be used to ask for the PIN; it
437
437
   should return the PIN in an allocated buffer and put it into PIN.  */
438
 
static int 
 
438
static gpg_error_t 
439
439
do_decipher (app_t app, const char *keyidstr,
440
 
             int (pincb)(void*, const char *, char **),
 
440
             gpg_error_t (*pincb)(void*, const char *, char **),
441
441
             void *pincb_arg,
442
442
             const void *indata, size_t indatalen,
443
443
             unsigned char **outdata, size_t *outdatalen )
444
444
{
445
445
  static const unsigned char mse_parm[] = {
446
446
    0x80, 1, 0x10, /* Select algorithm RSA. */
447
 
    0x84, 1, 0x81  /* Select locak secret key 1 for descryption. */
 
447
    0x84, 1, 0x81  /* Select local secret key 1 for decryption. */
448
448
  };
449
449
  int rc, i;
450
450
  int fid;
485
485
 
486
486
 
487
487
/* Select the NKS 2.0 application on the card in SLOT.  */
488
 
int
 
488
gpg_error_t
489
489
app_select_nks (APP app)
490
490
{
491
491
  static char const aid[] = { 0xD2, 0x76, 0x00, 0x00, 0x03, 0x01, 0x02 };