From 0985c6d8010ca3d7399314ac53352fda74995ec6 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 31 May 2013 15:47:04 +0200 Subject: 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. --- smime/gui/component.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'smime') 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, -- cgit