aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-10-30 18:04:42 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-10-30 18:04:42 +0800
commit552172a0e2b51d67886eaaa07a2612e7b9f5fc15 (patch)
treedc480886da78577b21c72398dcef47e801310254
parent8747a6919fbd4e318cceb8638f01d6f37e2d82f1 (diff)
downloadgsoc2013-evolution-552172a0e2b51d67886eaaa07a2612e7b9f5fc15.tar.gz
gsoc2013-evolution-552172a0e2b51d67886eaaa07a2612e7b9f5fc15.tar.zst
gsoc2013-evolution-552172a0e2b51d67886eaaa07a2612e7b9f5fc15.zip
implement something basic.
2003-10-30 Not Zed <NotZed@Ximian.com> * camel-smime-context.c (sm_get_passwd): implement something basic. svn path=/trunk/; revision=23130
-rw-r--r--camel/ChangeLog2
-rw-r--r--camel/camel-smime-context.c17
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 *