[gnus git] branch master updated: m0-11-201-gfbd6ec3 =1= plstore.el (plstore--decrypt): Clear entry in `plstore-passphrase-alist' if decryption failed (bug#20030)

Katsumi <[email protected]> Tue, 31 Mar 2015 14:42:40 +0200
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  fbd6ec30603d7d417156eb0b721fd4719a88bb7e (commit)
      from  5cd64f66463c20694512ac3d4e35a8a9886370c0 (commit)


- Log -----------------------------------------------------------------
commit fbd6ec30603d7d417156eb0b721fd4719a88bb7e
Author: Daiki Ueno <[email protected]>
Date:   Tue Mar 31 12:42:30 2015 +0000

    plstore.el (plstore--decrypt): Clear entry in `plstore-passphrase-alist' if decryption failed (bug#20030)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 36a35fd..77573c6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2015-03-31  Daiki Ueno  <[email protected]>
+
+	* plstore.el (plstore--decrypt): Clear entry in
+	`plstore-passphrase-alist' if decryption failed (bug#20030).
+
 2015-03-28  Adam Sjøgren  <[email protected]>
 
 	* gnus-sum.el (gnus-summary-make-menu-bar): Add "Display HTML images"
diff --git a/lisp/plstore.el b/lisp/plstore.el
index 12a0413..175e272 100644
--- a/lisp/plstore.el
+++ b/lisp/plstore.el
@@ -270,9 +270,16 @@ symmetric encryption will be used.")
 	 context
 	 (cons #'plstore-progress-callback-function
 	       (format "Decrypting %s" (plstore-get-file plstore))))
+	(condition-case error
 	    (setq plain
 		  (epg-decrypt-string context
 				      (plstore--get-encrypted-data plstore)))
+	  (error
+	   (let ((entry (assoc (plstore-get-file plstore)
+			       plstore-passphrase-alist)))
+	     (if entry
+		 (setcdr entry nil)))
+	   (signal (car error) (cdr error))))
 	(plstore--set-secret-alist plstore (car (read-from-string plain)))
 	(plstore--merge-secret plstore)
 	(plstore--set-encrypted-data plstore nil))))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog  |    5 +++++
 lisp/plstore.el |   13 ++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project