From d6855c5e8828e26638ea79bab7f9835e93c771fa Mon Sep 17 00:00:00 2001 From: ueno Date: Sat, 20 Nov 1999 11:43:37 +0000 Subject: [PATCH] * pgg-def.el (pgg-cache-passphrase): New user option. * pgg.el (pgg-read-passphrase): Refer `pgg-cache-passphrase'. * pgg-gpg.el, pgg-pgp.el, pgg-pgp5.el (sign-region): Refer `pgg-cache-passphrase'. --- pgg-def.el | 5 +++++ pgg-gpg.el | 7 ++++--- pgg-pgp.el | 7 ++++--- pgg-pgp5.el | 7 ++++--- pgg.el | 3 ++- 5 files changed, 19 insertions(+), 10 deletions(-) diff --git a/pgg-def.el b/pgg-def.el index 56e53e6..c8fef62 100644 --- a/pgg-def.el +++ b/pgg-def.el @@ -51,6 +51,11 @@ :group 'pgg :type 'boolean) +(defcustom pgg-cache-passphrase t + "Cache passphrase" + :group 'pgg + :type 'boolean) + (defvar pgg-status-buffer " *PGG status*") (defvar pgg-errors-buffer " *PGG errors*") (defvar pgg-output-buffer " *PGG output*") diff --git a/pgg-gpg.el b/pgg-gpg.el index a2fb864..d6bda0d 100644 --- a/pgg-gpg.el +++ b/pgg-gpg.el @@ -207,9 +207,10 @@ (progn (beginning-of-line 2) (point)) (point-max)))))) - (pgg-add-passphrase-cache - (cdr (assq 'key-identifier packet)) - passphrase)))) + (if pgg-cache-passphrase + (pgg-add-passphrase-cache + (cdr (assq 'key-identifier packet)) + passphrase))))) )) (luna-define-method verify-region ((scheme pgg-scheme-gpg) diff --git a/pgg-pgp.el b/pgg-pgp.el index feadb9b..3ba9a96 100644 --- a/pgg-pgp.el +++ b/pgg-pgp.el @@ -194,9 +194,10 @@ (progn (beginning-of-line 2) (point)) (point-max)))))) - (pgg-add-passphrase-cache - (cdr (assq 'key-identifier packet)) - passphrase)))) + (if pgg-cache-passphrase + (pgg-add-passphrase-cache + (cdr (assq 'key-identifier packet)) + passphrase))))) )) (luna-define-method verify-region ((scheme pgg-scheme-pgp) diff --git a/pgg-pgp5.el b/pgg-pgp5.el index 9614b4e..fc8566e 100644 --- a/pgg-pgp5.el +++ b/pgg-pgp5.el @@ -206,9 +206,10 @@ (progn (beginning-of-line 2) (point)) (point-max)))))) - (pgg-add-passphrase-cache - (cdr (assq 'key-identifier packet)) - passphrase)))) + (if pgg-cache-passphrase + (pgg-add-passphrase-cache + (cdr (assq 'key-identifier packet)) + passphrase))))) )) (luna-define-method verify-region ((scheme pgg-scheme-pgp5) diff --git a/pgg.el b/pgg.el index e2e1123..2b4257c 100644 --- a/pgg.el +++ b/pgg.el @@ -201,7 +201,8 @@ and END to the keyring.") (setq pgg-read-passphrase 'read-passwd) (autoload 'ange-ftp-read-passwd "ange-ftp") (setq pgg-read-passphrase 'ange-ftp-read-passwd)))) - (or (and key (setq key (pgg-truncate-key-identifier key)) + (or (and pgg-cache-passphrase + key (setq key (pgg-truncate-key-identifier key)) (symbol-value (intern-soft key pgg-passphrase-cache))) (funcall pgg-read-passphrase prompt))) -- 1.7.10.4