changeset 65923:30343c286601

* pgg-pgp.el (pgg-pgp-decrypt-region): Use passphrase cache.
author Simon Josefsson <jas@extundo.com>
date Sat, 08 Oct 2005 08:45:31 +0000
parents ce1cf38cd09f
children 27e12359729e
files lisp/gnus/ChangeLog lisp/gnus/pgg-pgp.el
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Sat Oct 08 08:44:21 2005 +0000
+++ b/lisp/gnus/ChangeLog	Sat Oct 08 08:45:31 2005 +0000
@@ -1,3 +1,7 @@
+2005-01-21  Derek Atkins <warlord@MIT.EDU>  (tiny change)
+
+	* pgg-pgp.el (pgg-pgp-decrypt-region): Use passphrase cache.
+
 2005-10-08  Simon Josefsson  <jas@extundo.com>
 
 	* pgg-parse.el (top-level): Don't require custom, it is
--- a/lisp/gnus/pgg-pgp.el	Sat Oct 08 08:44:21 2005 +0000
+++ b/lisp/gnus/pgg-pgp.el	Sat Oct 08 08:45:31 2005 +0000
@@ -149,14 +149,16 @@
 (defun pgg-pgp-decrypt-region (start end)
   "Decrypt the current region between START and END."
   (let* ((pgg-pgp-user-id (or pgg-pgp-user-id pgg-default-user-id))
+	 (key (pgg-pgp-lookup-key pgg-pgp-user-id 'encrypt))
 	 (passphrase
 	  (pgg-read-passphrase
-	   (format "PGP passphrase for %s: " pgg-pgp-user-id)
-	   (pgg-pgp-lookup-key pgg-pgp-user-id 'encrypt)))
+	   (format "PGP passphrase for %s: " pgg-pgp-user-id) key))
 	 (args
 	  '("+verbose=1" "+batchmode" "+language=us" "-f")))
     (pgg-pgp-process-region start end passphrase pgg-pgp-program args)
-    (pgg-process-when-success nil)))
+    (pgg-process-when-success
+      (if pgg-cache-passphrase
+	  (pgg-add-passphrase-cache key passphrase)))))
 
 (defun pgg-pgp-sign-region (start end &optional clearsign)
   "Make detached signature from text between START and END."