~ubuntu-branches/ubuntu/oneiric/gnupg2/oneiric-updates

« back to all changes in this revision

Viewing changes to sm/import.c

  • Committer: Bazaar Package Importer
  • Author(s): Eric Dorland
  • Date: 2009-03-08 22:46:47 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: james.westby@ubuntu.com-20090308224647-gq17gatcl71lrc2k
Tags: 2.0.11-1
* New upstream release. (Closes: #496663)
* debian/control: Make the description a little more distinctive than
  gnupg v1's. Thanks Jari Aalto. (Closes: #496323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
460
460
   output to OUTFILE and the pid of the process in PID.  Returns 0 on
461
461
   success or an error code. */
462
462
static gpg_error_t
463
 
popen_protect_tool (const char *pgmname,
 
463
popen_protect_tool (ctrl_t ctrl, const char *pgmname,
464
464
                    FILE *infile, FILE *outfile, FILE **statusfile, pid_t *pid)
465
465
{
466
466
  const char *argv[20];
467
467
  int i=0;
468
468
 
 
469
  /* Make sure that the agent is running so that the protect tool is
 
470
     able to ask for a passphrase.  This has only an effect under W32
 
471
     where the agent is started on demand; sending a NOP does not harm
 
472
     on other platforms. */
 
473
  gpgsm_agent_send_nop (ctrl);
 
474
 
469
475
  argv[i++] = "--homedir";
470
476
  argv[i++] = opt.homedir;
471
477
  argv[i++] = "--p12-import";
551
557
      goto cleanup;
552
558
    }
553
559
 
554
 
  err = popen_protect_tool (pgmname, tmpfp, certfp, &fp, &pid);
 
560
  err = popen_protect_tool (ctrl, pgmname, tmpfp, certfp, &fp, &pid);
555
561
  if (err)
556
562
    {
557
563
      pid = -1;
597
603
                      stats->secret_dups++;
598
604
                    }
599
605
                  else if ( !strcmp (p, "bad-passphrase"))
600
 
                    ;
 
606
                    {
 
607
 
 
608
                    }
601
609
                }
602
610
              else 
603
611
                {
652
660
    {
653
661
      /* We only write a plain error code and not direct
654
662
         BAD_PASSPHRASE because the pkcs12 parser might issue this
655
 
         message multiple times, BAd_PASSPHRASE in general requires a
 
663
         message multiple times, BAD_PASSPHRASE in general requires a
656
664
         keyID and parts of the import might actually succeed so that
657
665
         IMPORT_PROBLEM is also not appropriate. */
658
666
      gpgsm_status_with_err_code (ctrl, STATUS_ERROR,