aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2006-12-30 18:10:35 +0000
committerEli Zaretskii2006-12-30 18:10:35 +0000
commit6eb0a10dd48698c662d75756452da2ade5e30248 (patch)
treee93e4662e08c475d3808c89cf2f8497b7872f2f3
parentb8be4eb4bc34d00c36429279ac745bed96f734c3 (diff)
downloademacs-6eb0a10dd48698c662d75756452da2ade5e30248.tar.gz
emacs-6eb0a10dd48698c662d75756452da2ade5e30248.zip
(allout-encrypt-string): Handle symmetric-key passphrase caching but leave
keypair caching to pgg.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/allout.el30
2 files changed, 18 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d865ceb9985..b2423e35600 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12006-12-30 Ken Manheimer <ken.manheimer@gmail.com>
2
3 * allout.el (allout-encrypt-string): Handle symmetric-key
4 passphrase caching but leave keypair caching to pgg.
5
12006-12-30 Michael Albinus <michael.albinus@gmx.de> 62006-12-30 Michael Albinus <michael.albinus@gmx.de>
2 7
3 Sync with Tramp 2.0.55. 8 Sync with Tramp 2.0.55.
diff --git a/lisp/allout.el b/lisp/allout.el
index 915f243eb4d..02d67671008 100644
--- a/lisp/allout.el
+++ b/lisp/allout.el
@@ -5750,10 +5750,9 @@ it forces prompting for the passphrase regardless of availability from the
5750passphrase cache. With no universal argument, the appropriate passphrase 5750passphrase cache. With no universal argument, the appropriate passphrase
5751is obtained from the cache, if available, else from the user. 5751is obtained from the cache, if available, else from the user.
5752 5752
5753Currently only GnuPG encryption is supported, and integration 5753Only GnuPG encryption is supported.
5754with gpg-agent is not yet implemented.
5755 5754
5756\**NOTE WELL** that the encrypted text must be ascii-armored. For gnupg 5755\*NOTE WELL* that the encrypted text must be ascii-armored. For gnupg
5757encryption, include the option ``armor'' in your ~/.gnupg/gpg.conf file. 5756encryption, include the option ``armor'' in your ~/.gnupg/gpg.conf file.
5758 5757
5759Both symmetric-key and key-pair encryption is implemented. Symmetric is 5758Both symmetric-key and key-pair encryption is implemented. Symmetric is
@@ -5767,8 +5766,8 @@ not. When a file with topics pending encryption is saved, topics pending
5767encryption are encrypted. See allout-encrypt-unencrypted-on-saves for 5766encryption are encrypted. See allout-encrypt-unencrypted-on-saves for
5768auto-encryption specifics. 5767auto-encryption specifics.
5769 5768
5770\**NOTE WELL** that automatic encryption that happens during saves will 5769\*NOTE WELL* that automatic encryption that happens during saves will
5771default to symmetric encryption - you must manually (re)encrypt key-pair 5770default to symmetric encryption - you must deliberately (re)encrypt key-pair
5772encrypted topics if you want them to continue to use the key-pair cipher. 5771encrypted topics if you want them to continue to use the key-pair cipher.
5773 5772
5774Level-one topics, with prefix consisting solely of an `*' asterisk, cannot be 5773Level-one topics, with prefix consisting solely of an `*' asterisk, cannot be
@@ -5780,10 +5779,8 @@ encrypted. If you want to encrypt the contents of a top-level topic, use
5780The encryption passphrase is solicited if not currently available in the 5779The encryption passphrase is solicited if not currently available in the
5781passphrase cache from a recent encryption action. 5780passphrase cache from a recent encryption action.
5782 5781
5783The solicited passphrase is retained for reuse in a buffer-specific cache 5782The solicited passphrase is retained for reuse in a cache, if enabled. See
5784for some set period of time (default, 60 seconds), after which the string 5783`pgg-cache-passphrase' and `pgg-passphrase-cache-expiry' for details.
5785is nulled. The passphrase cache timeout is customized by setting
5786`pgg-passphrase-cache-expiry'.
5787 5784
5788 Symmetric Passphrase Hinting and Verification 5785 Symmetric Passphrase Hinting and Verification
5789 5786
@@ -6001,8 +5998,10 @@ Returns the resulting string, or nil if the transformation fails."
6001 (rejections-left (- allout-encryption-ciphertext-rejection-ceiling 5998 (rejections-left (- allout-encryption-ciphertext-rejection-ceiling
6002 rejected)) 5999 rejected))
6003 result-text status 6000 result-text status
6004 ;; Inhibit use of gpg-agent in the scope of this let: 6001 ;; Inhibit gpg-agent use for symmetric keys in the scope of this let:
6005 (pgg-gpg-use-agent nil)) 6002 (pgg-gpg-use-agent (if (equal key-type 'keypair)
6003 pgg-gpg-use-agent
6004 nil)))
6006 6005
6007 (if (and fetch-pass (not passphrase)) 6006 (if (and fetch-pass (not passphrase))
6008 ;; Force later fetch by evicting passphrase from the cache. 6007 ;; Force later fetch by evicting passphrase from the cache.
@@ -6010,12 +6009,9 @@ Returns the resulting string, or nil if the transformation fails."
6010 6009
6011 (catch 'encryption-failed 6010 (catch 'encryption-failed
6012 6011
6013 ;; Obtain the passphrase if we don't already have one and we're not 6012 ;; We handle only symmetric-key passphrase caching.
6014 ;; doing a keypair encryption: 6013 (if (and (not passphrase)
6015 (if (not (or passphrase 6014 (not (equal key-type 'keypair)))
6016 (and (equal key-type 'keypair)
6017 (not decrypt))))
6018
6019 (setq passphrase (allout-obtain-passphrase for-key 6015 (setq passphrase (allout-obtain-passphrase for-key
6020 target-cache-id 6016 target-cache-id
6021 target-prompt-id 6017 target-prompt-id