Mercurial > emacs
diff lisp/gnus/mm-view.el @ 111501:5b30cfe2d392
Make mm-dissect-buffer pass sender's mail address to smime-decrypt-region.
mm-decode.el (mm-dissect-buffer): Pass sender's mail address to smime-decrypt-region using function argument.
mm-decode.el (mm-possibly-verify-or-decrypt, mm-dissect-multipart): Relay it.
mm-view.el (mm-view-pkcs7, mm-view-pkcs7-decrypt): Relay it.
smime.el (smime-decrypt-region): Catch it.
author | Katsumi Yamaoka <yamaoka@jpl.org> |
---|---|
date | Thu, 11 Nov 2010 23:51:05 +0000 |
parents | 3e377e8bbed5 |
children | 52100bac91db |
line wrap: on
line diff
--- a/lisp/gnus/mm-view.el Thu Nov 11 17:24:03 2010 -0500 +++ b/lisp/gnus/mm-view.el Thu Nov 11 23:51:05 2010 +0000 @@ -653,9 +653,9 @@ (t (error "Could not identify PKCS#7 type"))))) -(defun mm-view-pkcs7 (handle) +(defun mm-view-pkcs7 (handle &optional from) (case (mm-view-pkcs7-get-type handle) - (enveloped (mm-view-pkcs7-decrypt handle)) + (enveloped (mm-view-pkcs7-decrypt handle from)) (signed (mm-view-pkcs7-verify handle)) (otherwise (error "Unknown or unimplemented PKCS#7 type")))) @@ -680,7 +680,7 @@ (replace-match "\n")) t) -(defun mm-view-pkcs7-decrypt (handle) +(defun mm-view-pkcs7-decrypt (handle &optional from) (insert-buffer-substring (mm-handle-buffer handle)) (goto-char (point-min)) (insert "MIME-Version: 1.0\n") @@ -692,7 +692,8 @@ (smime-get-key-by-email (gnus-completing-read "Decipher using key" - smime-keys nil nil nil (car-safe (car-safe smime-keys)))))) + smime-keys nil nil nil (car-safe (car-safe smime-keys))))) + from) (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n"))