X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/a5418f70809c7add030eab14c4eb5123b7b05ce8..963541a6540c40559645c312cea7f35c3c649556:/lisp/gnus/plstore.el diff --git a/lisp/gnus/plstore.el b/lisp/gnus/plstore.el index b428cab64e..e327bbd484 100644 --- a/lisp/gnus/plstore.el +++ b/lisp/gnus/plstore.el @@ -1,5 +1,5 @@ ;;; plstore.el --- secure plist store -*- lexical-binding: t -*- -;; Copyright (C) 2011-2012 Free Software Foundation, Inc. +;; Copyright (C) 2011-2016 Free Software Foundation, Inc. ;; Author: Daiki Ueno ;; Keywords: PGP, GnuPG @@ -270,9 +270,16 @@ symmetric encryption will be used.") context (cons #'plstore-progress-callback-function (format "Decrypting %s" (plstore-get-file plstore)))) - (setq plain - (epg-decrypt-string context - (plstore--get-encrypted-data 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))))