~ubuntu-branches/ubuntu/karmic/gnupg2/karmic-security

« back to all changes in this revision

Viewing changes to agent/protect-tool.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:
630
630
  struct b64state state;
631
631
  gpg_error_t err, err2;
632
632
 
 
633
  (void)opaque;
 
634
 
633
635
  err = b64enc_start (&state, stdout, "CERTIFICATE");
634
636
  if (!err)
635
637
    err = b64enc_write (&state, cert, certlen);
752
754
  gcry_sexp_release (s_key);
753
755
 
754
756
 
755
 
  rc = agent_protect (key, (pw=get_new_passphrase (4)), &result, &resultlen);
 
757
  pw = get_new_passphrase (4);
 
758
  if (!pw)
 
759
    rc = gpg_error (GPG_ERR_CANCELED);
 
760
  else
 
761
    rc = agent_protect (key, pw, &result, &resultlen);
756
762
  release_passphrase (pw);
757
763
  xfree (key);
758
764
  if (rc)
979
985
  kparms[7] = sk.u;
980
986
  kparms[8] = NULL;
981
987
 
982
 
  key = p12_build (kparms, cert, certlen,
983
 
                   (pw=get_new_passphrase (3)), opt_p12_charset, &keylen);
 
988
  pw = get_new_passphrase (3);
 
989
  if (!pw)
 
990
    key = NULL;
 
991
  else
 
992
    key = p12_build (kparms, cert, certlen, pw, opt_p12_charset, &keylen);
984
993
  release_passphrase (pw);
985
994
  xfree (cert);
986
995
  for (i=0; i < 8; i++)
1057
1066
  log_set_prefix ("gpg-protect-tool", 1); 
1058
1067
 
1059
1068
  /* Make sure that our subsystems are ready.  */
 
1069
  i18n_init ();
1060
1070
  init_common_subsystems ();
1061
1071
 
1062
 
  i18n_init ();
1063
 
 
1064
1072
  if (!gcry_check_version (NEED_LIBGCRYPT_VERSION) )
1065
1073
    {
1066
1074
      log_fatal( _("%s is too old (need %s, have %s)\n"), "libgcrypt",