aboutsummaryrefslogtreecommitdiffstats
path: root/g10/passphrase.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2014-04-14 12:40:18 +0000
committerWerner Koch <[email protected]>2014-04-15 17:29:57 +0000
commite549799db66be30cdd68a3e6cdca9c6a050466d1 (patch)
tree98b6623d6e2908631988b5692891676cdc9c43b2 /g10/passphrase.c
parentagent: Add command DELETE_KEY. (diff)
downloadgnupg-e549799db66be30cdd68a3e6cdca9c6a050466d1.tar.gz
gnupg-e549799db66be30cdd68a3e6cdca9c6a050466d1.zip
gpg: Change pinentry prompt to talk about "secret key".
* g10/passphrase.c (gpg_format_keydesc): Add mode 2. Change strings. * g10/keydb.h (FORMAT_KEYDESC_NORMAL, FORMAT_KEYDESC_IMPORT) (FORMAT_KEYDESC_EXPORT): New. Use them for clarity. -- The use of the term "certificate" was more confusing than helpful.
Diffstat (limited to 'g10/passphrase.c')
-rw-r--r--g10/passphrase.c40
1 files changed, 30 insertions, 10 deletions
diff --git a/g10/passphrase.c b/g10/passphrase.c
index bd0f0ffb0..7c1d6aa08 100644
--- a/g10/passphrase.c
+++ b/g10/passphrase.c
@@ -645,29 +645,49 @@ gpg_format_keydesc (PKT_public_key *pk, int mode, int escaped)
char *maink;
char *desc;
const char *prompt;
+ const char *trailer = "";
+ int is_subkey;
+ is_subkey = (pk->main_keyid[0] && pk->main_keyid[1]
+ && pk->keyid[0] != pk->main_keyid[0]
+ && pk->keyid[1] != pk->main_keyid[1]);
algo_name = openpgp_pk_algo_name (pk->pubkey_algo);
timestr = strtimestamp (pk->timestamp);
- uid = get_user_id (pk->keyid, &uidlen);
+ uid = get_user_id (is_subkey? pk->main_keyid:pk->keyid, &uidlen);
orig_codeset = i18n_switchto_utf8 ();
- if (pk->main_keyid[0] && pk->main_keyid[1]
- && pk->keyid[0] != pk->main_keyid[0]
- && pk->keyid[1] != pk->main_keyid[1])
+ if (is_subkey)
maink = xtryasprintf (_(" (main key ID %s)"), keystr (pk->main_keyid));
else
maink = NULL;
switch (mode)
{
- case 0:
+ case FORMAT_KEYDESC_NORMAL:
prompt = _("Please enter the passphrase to unlock the"
- " secret key for the OpenPGP certificate:");
+ " OpenPGP secret key:");
break;
- case 1:
+ case FORMAT_KEYDESC_IMPORT:
prompt = _("Please enter the passphrase to import the"
- " secret key for the OpenPGP certificate:");
+ " OpenPGP secret key:");
+ break;
+ case FORMAT_KEYDESC_EXPORT:
+ if (is_subkey)
+ prompt = _("Please enter the passphrase to export the"
+ " OpenPGP secret subkey:");
+ else
+ prompt = _("Please enter the passphrase to export the"
+ " OpenPGP secret key:");
+ break;
+ case FORMAT_KEYDESC_DELKEY:
+ if (is_subkey)
+ prompt = _("Do you really want to permanently delete the"
+ " OpenPGP secret subkey key:");
+ else
+ prompt = _("Do you really want to permanently delete the"
+ " OpenPGP secret key:");
+ trailer = "?";
break;
default:
prompt = "?";
@@ -677,12 +697,12 @@ gpg_format_keydesc (PKT_public_key *pk, int mode, int escaped)
desc = xtryasprintf (_("%s\n"
"\"%.*s\"\n"
"%u-bit %s key, ID %s,\n"
- "created %s%s.\n"),
+ "created %s%s.\n%s"),
prompt,
(int)uidlen, uid,
nbits_from_pk (pk), algo_name,
keystr (pk->keyid), timestr,
- maink?maink:"" );
+ maink?maink:"", trailer );
xfree (maink);
xfree (uid);