[evolution] Ask for a Smart Card password with a token name too



commit 0985c6d8010ca3d7399314ac53352fda74995ec6
Author: Milan Crha <mcrha redhat com>
Date:   Fri May 31 15:47:04 2013 +0200

    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 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/smime/gui/component.c b/smime/gui/component.c
index e2e3e1e..790bb68 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]