aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
Diffstat (limited to 'camel')
-rw-r--r--camel/ChangeLog2
-rw-r--r--camel/camel-gpg-context.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index ce09271a00..11be020513 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -4,6 +4,8 @@
than --passphrase-fd since what we really want is an interactive
mode (besides, --passphrase-fd requires a passphrase to be sent
before --status-fd will send a NEED_PASSPHRASE status message).
+ (gpg_ctx_parse_status): When we encounter a BAD_PASSPHRASE, tell
+ the session to uncache it.
2002-06-23 Jeffrey Stedfast <fejj@ximian.com>
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index fe4637c5e5..75ecce6704 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -709,7 +709,9 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
passwd = camel_session_get_password (gpg->session, prompt, TRUE, NULL, userid, ex);
g_free (prompt);
- g_free (userid);
+
+ g_free (gpg->userid);
+ gpg->userid = userid;
if (passwd == NULL) {
if (!camel_exception_is_set (ex))
@@ -726,6 +728,9 @@ gpg_ctx_parse_status (struct _GpgCtx *gpg, CamelException *ex)
gpg->bad_passwds = 0;
} else if (!strncmp (status, "BAD_PASSPHRASE ", 15)) {
gpg->bad_passwds++;
+
+ camel_session_forget_password (gpg->session, NULL, gpg->userid, ex);
+
if (gpg->bad_passwds == 3) {
camel_exception_set (ex, CAMEL_EXCEPTION_SERVICE_CANT_AUTHENTICATE,
_("Failed to unlock secret key: 3 bad passphrases given."));