diff options
-rw-r--r-- | camel/ChangeLog | 2 | ||||
-rw-r--r-- | camel/camel-smime-context.c | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index 6d6b16e35c..6d6ada2e4a 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,7 @@ 2003-10-30 Not Zed <NotZed@Ximian.com> + * camel-smime-context.c (sm_get_passwd): implement something basic. + * camel-cipher-context.h: Added a note about api inconsistencies. 2003-10-30 Not Zed <NotZed@Ximian.com> diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c index ea6a73760d..9fad5a1f11 100644 --- a/camel/camel-smime-context.c +++ b/camel/camel-smime-context.c @@ -149,9 +149,22 @@ sm_decrypt_key(void *arg, SECAlgorithmID *algid) static char * sm_get_passwd(PK11SlotInfo *info, PRBool retry, void *arg) { - printf("Password requested for '%s'\n", PK11_GetTokenName(info)); + CamelSMIMEContext *context = arg; + char *pass, *nsspass = NULL; + char *prompt; + CamelException *ex; + + ex = camel_exception_new(); + prompt = g_strdup_printf(_("Enter security pass-phrase for `%s'"), PK11_GetTokenName(info)); + pass = camel_session_get_password(((CamelCipherContext *)context)->session, prompt, FALSE, TRUE, NULL, PK11_GetTokenName(info), ex); + camel_exception_free(ex); + g_free(prompt); + if (pass) { + nsspass = PORT_Strdup(pass); + g_free(pass); + } - return NULL; + return nsspass; } static NSSCMSMessage * |