From 49d87cf640afc8e9b9b376fa677728077ba9cda5 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 25 Jun 2002 00:54:20 +0000 Subject: Use --command-fd rather than --passphrase-fd since what we really want is 2002-06-24 Jeffrey Stedfast * 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 --- camel/ChangeLog | 2 ++ camel/camel-gpg-context.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) 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 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.")); -- cgit