aboutsummaryrefslogtreecommitdiffstats
path: root/smime
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-05-31 21:47:04 +0800
committerMilan Crha <mcrha@redhat.com>2013-05-31 21:47:04 +0800
commit0985c6d8010ca3d7399314ac53352fda74995ec6 (patch)
treea5d28d415ce6db1cd26cd0a88e25038a29d72c7a /smime
parentef5795c3fd5186f42f54a2695db8d6c1bd46f489 (diff)
downloadgsoc2013-evolution-0985c6d8010ca3d7399314ac53352fda74995ec6.tar.gz
gsoc2013-evolution-0985c6d8010ca3d7399314ac53352fda74995ec6.tar.zst
gsoc2013-evolution-0985c6d8010ca3d7399314ac53352fda74995ec6.zip
Ask for a Smart Card password with a token name too
Some cards can have two PINs, one 'global' and one 'application'. NSS provides which token is required, but Evolution didn't show that information to a user.
Diffstat (limited to 'smime')
-rw-r--r--smime/gui/component.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/smime/gui/component.c b/smime/gui/component.c
index e2e3e1e574..790bb68ff5 100644
--- a/smime/gui/component.c
+++ b/smime/gui/component.c
@@ -45,11 +45,20 @@ smime_pk11_passwd (ECertDB *db,
{
gchar *prompt;
gchar *slot_name = g_strdup (PK11_GetSlotName (slot));
+ gchar *token_name = g_strdup (PK11_GetTokenName (slot));
g_strchomp (slot_name);
- prompt = g_strdup_printf (_("Enter the password for '%s'"), slot_name);
+ if (token_name)
+ g_strchomp (token_name);
+
+ if (token_name && *token_name && g_ascii_strcasecmp (slot_name, token_name) != 0)
+ prompt = g_strdup_printf (_("Enter the password for '%s', token '%s'"), slot_name, token_name);
+ else
+ prompt = g_strdup_printf (_("Enter the password for '%s'"), slot_name);
+
g_free (slot_name);
+ g_free (token_name);
*passwd = e_passwords_ask_password (
_("Enter password"), "", prompt,