summaryrefslogtreecommitdiff
path: root/lisp/gnus/mm-decode.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2020-09-07 16:29:59 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2020-09-07 16:29:59 +0200
commit0c4789e2defee35237651961391d0da69fbe26d8 (patch)
treee38891b8d48dc90a1f9fd23422db7abba12cd233 /lisp/gnus/mm-decode.el
parentc8472cc69d4bce7f53c9a62966245a4de3d99fbd (diff)
downloademacs-0c4789e2defee35237651961391d0da69fbe26d8.tar.gz
Show the status of signed + encrypted S/MIME messages in Gnus
* lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): Use the data to tell the caller (i.e., Gnus) something about the validation of signed + encrypted S/MIME messages. * lisp/gnus/mm-view.el (mm-view-pkcs7-verify): Pass along details about whether we could validate the signature or not (bug#42637).
Diffstat (limited to 'lisp/gnus/mm-decode.el')
-rw-r--r--lisp/gnus/mm-decode.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el
index a01fd2729af..1bce6ca020e 100644
--- a/lisp/gnus/mm-decode.el
+++ b/lisp/gnus/mm-decode.el
@@ -1665,12 +1665,14 @@ If RECURSIVE, search recursively."
(let ((type (car ctl))
(subtype (cadr (split-string (car ctl) "/")))
(mm-security-handle ctl) ;; (car CTL) is the type.
+ (smime-type (cdr (assq 'smime-type (mm-handle-type parts))))
protocol func functest)
(cond
((or (equal type "application/x-pkcs7-mime")
(equal type "application/pkcs7-mime"))
(with-temp-buffer
(when (and (cond
+ ((equal smime-type "signed-data") t)
((eq mm-decrypt-option 'never) nil)
((eq mm-decrypt-option 'always) t)
((eq mm-decrypt-option 'known) t)
@@ -1691,7 +1693,21 @@ If RECURSIVE, search recursively."
(unless (mail-fetch-field "content-type")
(goto-char (point-max))
(insert "Content-type: text/plain\n\n")))
- (setq parts (mm-dissect-buffer t)))))
+ (setq parts
+ (if (equal smime-type "signed-data")
+ (list (propertize
+ "multipart/signed"
+ 'protocol "application/pkcs7-signature"
+ 'gnus-info
+ (format
+ "%s:%s"
+ (get-text-property 0 'gnus-info
+ (car mm-security-handle))
+ (get-text-property 0 'gnus-details
+ (car mm-security-handle))))
+ (mm-dissect-buffer t)
+ parts)
+ (mm-dissect-buffer t))))))
((equal subtype "signed")
(unless (and (setq protocol
(mm-handle-multipart-ctl-parameter ctl 'protocol))