aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog12
-rw-r--r--camel/camel-smime-context.c13
-rw-r--r--camel/providers/local/camel-local-folder.c2
3 files changed, 23 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index da05938fb7..6eaa791db5 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,15 @@
+2004-01-14 Not Zed <NotZed@Ximian.com>
+
+ * providers/local/camel-local-folder.c (local_getv): remove debug
+ printf.
+
+ ** See bug #52835.
+
+ * camel-smime-context.c (sm_get_passwd): removed debugging. If we
+ get called multiple times in a row, then forget the old password
+ and re-prompt - it was a bad password. Zero out password memory
+ too.
+
2004-01-13 Rodrigo Moya <rodrigo@ximian.com>
* providers/groupwise/camel-groupwise-provider.c: missing renaming.
diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c
index 5b29d47681..8b132b6968 100644
--- a/camel/camel-smime-context.c
+++ b/camel/camel-smime-context.c
@@ -65,6 +65,7 @@ struct _CamelSMIMEContextPrivate {
char *encrypt_key;
camel_smime_sign_t sign_mode;
+ int password_tries;
unsigned int send_encrypt_key_prefs:1;
};
@@ -92,16 +93,23 @@ sm_get_passwd(PK11SlotInfo *info, PRBool retry, void *arg)
char *prompt;
CamelException *ex;
- printf("get passwd called '%s'\n", PK11_GetTokenName(info));
-
ex = camel_exception_new();
+
+ /* we got a password, but its asking again, the password we had was wrong */
+ if (context->priv->password_tries > 0) {
+ camel_session_forget_password(((CamelCipherContext *)context)->session, NULL, PK11_GetTokenName(info), NULL);
+ context->priv->password_tries = 0;
+ }
+
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);
+ memset(pass, 0, strlen(pass));
g_free(pass);
+ context->priv->password_tries++;
}
return nsspass;
@@ -1036,6 +1044,7 @@ camel_smime_context_init(CamelSMIMEContext *context)
context->priv = g_malloc0(sizeof(*context->priv));
context->priv->certdb = CERT_GetDefaultCertDB();
context->priv->sign_mode = CAMEL_SMIME_SIGN_CLEARSIGN;
+ context->priv->password_tries = 0;
}
static void
diff --git a/camel/providers/local/camel-local-folder.c b/camel/providers/local/camel-local-folder.c
index 5bf2142f35..7bb7d4d40a 100644
--- a/camel/providers/local/camel-local-folder.c
+++ b/camel/providers/local/camel-local-folder.c
@@ -408,8 +408,6 @@ local_getv(CamelObject *object, CamelException *ex, CamelArgGetV *args)
break; }
case CAMEL_LOCAL_FOLDER_ARG_INDEX_BODY:
- printf("getv:'%s' flags %08x\n", ((CamelFolder *)object)->full_name, ((CamelLocalFolder *)object)->flags);
-
/* FIXME: remove this from sotre flags */
*arg->ca_int = (((CamelLocalFolder *)folder)->flags & CAMEL_STORE_FOLDER_BODY_INDEX) != 0;
break;