summaryrefslogtreecommitdiff
path: root/lisp/gnus/mml2015.el
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@unixuser.org>2010-12-27 18:46:02 +0900
committerDaiki Ueno <ueno@unixuser.org>2010-12-27 18:46:02 +0900
commitfdee7cc1ac2d03ba7ba80349170b37bdc3d3d819 (patch)
tree68ca27180aa7a73dda6293bae3deeee63f8bbd75 /lisp/gnus/mml2015.el
parent9ebea0e7469db88856f238d113878913503266d0 (diff)
downloademacs-fdee7cc1ac2d03ba7ba80349170b37bdc3d3d819.tar.gz
Make GPG-sign-by-sender code robuster.
* mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Take care the case when sender is not given.
Diffstat (limited to 'lisp/gnus/mml2015.el')
-rw-r--r--lisp/gnus/mml2015.el26
1 files changed, 21 insertions, 5 deletions
diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el
index e247abbb476..abcb0fda13e 100644
--- a/lisp/gnus/mml2015.el
+++ b/lisp/gnus/mml2015.el
@@ -951,7 +951,11 @@ Whether the passphrase is cached at all is controlled by
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- (cons sender mml2015-signers) t)
+ (if sender
+ (cons (concat "<" sender ">")
+ mml2015-signers)
+ mml2015-signers)
+ t)
(if (or sender mml2015-signers)
(delq nil
(mapcar
@@ -966,7 +970,10 @@ If no one is selected, default secret key is used. "
signer)))
(error "No secret key for %s" signer))
signer-key)
- (cons sender mml2015-signers))))))))
+ (if sender
+ (cons (concat "<" sender ">")
+ mml2015-signers)
+ mml2015-signers))))))))
signature micalg)
(epg-context-set-armor context t)
(epg-context-set-textmode context t)
@@ -1029,7 +1036,10 @@ If no one is selected, default secret key is used. "
(when mml2015-encrypt-to-self
(unless (or sender mml2015-signers)
(error "Message sender and mml2015-signers not set"))
- (setq recipients (nconc recipients (cons sender mml2015-signers))))
+ (setq recipients (nconc recipients (if sender
+ (cons (concat "<" sender ">")
+ mml2015-signers)
+ mml2015-signers))))
(if (eq mm-encrypt-option 'guided)
(setq recipients
(epa-select-keys context "\
@@ -1062,7 +1072,11 @@ If no one is selected, symmetric encryption will be performed. "
(epa-select-keys context "\
Select keys for signing.
If no one is selected, default secret key is used. "
- (cons sender mml2015-signers) t)
+ (if sender
+ (cons (concat "<" sender ">")
+ mml2015-signers)
+ mml2015-signers)
+ t)
(if (or sender mml2015-signers)
(delq nil
(mapcar
@@ -1077,7 +1091,9 @@ If no one is selected, default secret key is used. "
signer)))
(error "No secret key for %s" signer))
signer-key)
- (cons sender mml2015-signers))))))))
+ (if sender
+ (cons (concat "<" sender ">") mml2015-signers)
+ mml2015-signers))))))))
(epg-context-set-signers context signers))
(epg-context-set-armor context t)
(epg-context-set-textmode context t)