]> git.eshelyaron.com Git - emacs.git/commitdiff
* pgg-pgp.el (pgg-pgp-decrypt-region): Use passphrase cache.
authorSimon Josefsson <jas@extundo.com>
Sat, 8 Oct 2005 08:45:31 +0000 (08:45 +0000)
committerSimon Josefsson <jas@extundo.com>
Sat, 8 Oct 2005 08:45:31 +0000 (08:45 +0000)
lisp/gnus/ChangeLog
lisp/gnus/pgg-pgp.el

index 4f1a6077e181ac19cf8c762442825db9b6e80d57..f6167098ac73ea3bdf3c2dea924434eac380eb4b 100644 (file)
@@ -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
index 88f1d697200fb1cf530358f29900eae56b0bfed1..2735a0b7b271aa38a9c74da55613cc4a36912a43 100644 (file)
@@ -149,14 +149,16 @@ Bourne shell or its equivalent \(not tcsh) is needed for \"2>\"."
 (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."