diff options
author | Werner Koch <wk@gnupg.org> | 2010-09-06 21:57:42 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-09-06 21:57:42 +0200 |
commit | 299ed4c9e26f16ce5365ed69dde5e109aa4e4f9e (patch) | |
tree | 76ec60edc1f48dff9ad7b1d968ebedab0692dc14 /g10/passphrase.c | |
parent | Merge secret keys during import (diff) | |
download | gnupg2-299ed4c9e26f16ce5365ed69dde5e109aa4e4f9e.tar.xz gnupg2-299ed4c9e26f16ce5365ed69dde5e109aa4e4f9e.zip |
Removed more secret key related code.
It builds fine and passes some of the tests but there are quite some
features which don't work yet.
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r-- | g10/passphrase.c | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c index b934cb349..60560123f 100644 --- a/g10/passphrase.c +++ b/g10/passphrase.c @@ -686,10 +686,10 @@ passphrase_to_dek (u32 *keyid, int pubkey_algo, /* Return an allocated utf-8 string describing the key PK. IF ESCAPED - is true spaces and control characters are percent or plus - escaped. */ + is true spaces and control characters are percent or plus escaped. + MODE 0 is for the common prompt, MODE 1 for the import prompt. */ char * -gpg_format_keydesc (PKT_public_key *pk, int escaped) +gpg_format_keydesc (PKT_public_key *pk, int mode, int escaped) { char *uid; size_t uidlen; @@ -698,6 +698,7 @@ gpg_format_keydesc (PKT_public_key *pk, int escaped) char *orig_codeset; char *maink; char *desc; + const char *prompt; algo_name = gcry_pk_algo_name (pk->pubkey_algo); timestr = strtimestamp (pk->timestamp); @@ -712,11 +713,26 @@ gpg_format_keydesc (PKT_public_key *pk, int escaped) else maink = NULL; - desc = xtryasprintf (_("Please enter the passphrase to unlock the" - " secret key for the OpenPGP certificate:\n" + switch (mode) + { + case 0: + prompt = _("Please enter the passphrase to unlock the" + " secret key for the OpenPGP certificate:"); + break; + case 1: + prompt = _("Please enter the passphrase to import the" + " secret key for the OpenPGP certificate:"); + break; + default: + prompt = "?"; + break; + } + + desc = xtryasprintf (_("%s\n" "\"%.*s\"\n" "%u-bit %s key, ID %s,\n" "created %s%s.\n"), + prompt, (int)uidlen, uid, nbits_from_pk (pk), algo_name, keystr (pk->keyid), timestr, |