[gnus git] branch master updated: =1= * mm-view.el (mm-view-pkcs7-decrypt): If mml-smime-use is set to 'epg, use EPG to decrypt S/MIME messages instead of openssl.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  84f33dd19f522a59528341682bf9093c2834bab1 (commit)
      from  3286715e509f8ca70efd674d59f6c58e16fdf95a (commit)


- Log -----------------------------------------------------------------
commit 84f33dd19f522a59528341682bf9093c2834bab1
Author: David Engster <[email protected]>
Date:   Sun Jan 2 08:03:02 2011 +0100

    * mm-view.el (mm-view-pkcs7-decrypt): If mml-smime-use is set to 'epg,
    use EPG to decrypt S/MIME messages instead of openssl.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d15ecdd..70c6511 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2010-12-20  David Engster  <[email protected]>
+
+	* mm-view.el (mm-view-pkcs7-decrypt): If mml-smime-use is set to 'epg,
+	use EPG to decrypt S/MIME messages instead of openssl.
+
 2011-01-02  Lars Magne Ingebrigtsen  <[email protected]>
 
 	* nnimap.el (nnimap-request-group): Avoid double SELECT on `M-g'.
diff --git a/lisp/mm-view.el b/lisp/mm-view.el
index 083781b..f097a2f 100644
--- a/lisp/mm-view.el
+++ b/lisp/mm-view.el
@@ -683,6 +683,12 @@
 (defun mm-view-pkcs7-decrypt (handle &optional from)
   (insert-buffer-substring (mm-handle-buffer handle))
   (goto-char (point-min))
+  (if (eq mml-smime-use 'epg)
+      ;; Use EPG/gpgsm
+      (let ((part (base64-decode-string (buffer-string))))
+	(erase-buffer)
+	(insert (epg-decrypt-string (epg-make-context 'CMS) part)))
+    ;; Use openssl
   (insert "MIME-Version: 1.0\n")
   (mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
   (smime-decrypt-region
@@ -693,7 +699,7 @@
       (gnus-completing-read
        "Decipher using key"
        smime-keys nil nil nil (car-safe (car-safe smime-keys)))))
-   from)
+     from))
   (goto-char (point-min))
   (while (search-forward "\r\n" nil t)
     (replace-match "\n"))

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog  |    5 +++++
 lisp/mm-view.el |   28 +++++++++++++++++-----------
 2 files changed, 22 insertions(+), 11 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.