aboutsummaryrefslogtreecommitdiffstats
path: root/camel
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2002-06-25 08:54:20 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2002-06-25 08:54:20 +0800
commit49d87cf640afc8e9b9b376fa677728077ba9cda5 (patch)
tree10365594da73fa57934d5eab536c9c9e57ac30e9 /camel
parent5ded16a933f87f06c4dd8ad80f1da38fa07439e4 (diff)
downloadgsoc2013-evolution-49d87cf640afc8e9b9b376fa677728077ba9cda5.tar.gz
gsoc2013-evolution-49d87cf640afc8e9b9b376fa677728077ba9cda5.tar.zst
gsoc2013-evolution-49d87cf640afc8e9b9b376fa677728077ba9cda5.zip
Use --command-fd rather than --passphrase-fd since what we really want is
2002-06-24 Jeffrey Stedfast <fejj@ximian.com> * camel-gpg-context.c (gpg_ctx_get_argv): Use --command-fd rather 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. svn path=/trunk/; revision=17268
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."));