]> granicus.if.org Git - mutt/commitdiff
Automatically forget PGP passphrase on sign or decrypt error. (closes #1025)
authorBrendan Cully <brendan@kublai.com>
Mon, 1 Aug 2005 20:43:51 +0000 (20:43 +0000)
committerBrendan Cully <brendan@kublai.com>
Mon, 1 Aug 2005 20:43:51 +0000 (20:43 +0000)
pgp.c

diff --git a/pgp.c b/pgp.c
index 05ebb0a7a317ef0d38b9e0e1846aacf11cbad127..2bffc88be3a984ab18ebde390cc6df603b2d1261 100644 (file)
--- 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 */
   }