From: Daiki Ueno Date: Mon, 27 Dec 2010 09:46:02 +0000 (+0900) Subject: Make GPG-sign-by-sender code robuster. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~1322^2~278^2~62 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fdee7cc1ac2d03ba7ba80349170b37bdc3d3d819;p=emacs.git Make GPG-sign-by-sender code robuster. * mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Take care the case when sender is not given. --- diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 11e8cada0a1..63cc0ba141f 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,8 @@ +2010-12-27 Daiki Ueno + + * mml2015.el (mml2015-epg-sign, mml2015-epg-encrypt): Take care the + case when sender is not given. + 2010-12-23 Julien Danjou * gnus-gravatar.el (gnus-gravatar-transform-address): Set 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)