From: Brendan Cully Date: Mon, 1 Aug 2005 20:43:51 +0000 (+0000) Subject: Automatically forget PGP passphrase on sign or decrypt error. (closes #1025) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6c3370f3e6d1132b035160449f08da03962c6e15;p=neomutt Automatically forget PGP passphrase on sign or decrypt error. (closes #1025) --- diff --git a/pgp.c b/pgp.c index 05ebb0a7a..2bffc88be 100644 --- a/pgp.c +++ b/pgp.c @@ -920,7 +920,11 @@ void pgp_encrypted_handler (BODY *a, STATE *s) mutt_message _("PGP message successfully decrypted."); } else + { mutt_error _("Could not decrypt PGP message"); + /* void the passphrase, even if it's not necessarily the problem */ + pgp_void_passphrase (); + } fclose (fpout); mutt_unlink(tempfile); @@ -1020,6 +1024,8 @@ BODY *pgp_sign_message (BODY *a) if (empty) { unlink (sigfile); + /* most likely error is a bad passphrase, so automatically forget it */ + pgp_void_passphrase (); return (NULL); /* fatal error while signing */ }