summaryrefslogtreecommitdiff
path: root/lisp/gnus/mm-view.el
diff options
context:
space:
mode:
authorSebastian Fieber <sebastian.fieber@web.de>2021-12-24 10:43:52 +0100
committerLars Ingebrigtsen <larsi@gnus.org>2021-12-24 10:43:52 +0100
commitb6fac9aaaf21c12a25e1cbec9cb8b8d14d2dc8a8 (patch)
treef50a3eaf22d8e4b0b862982473dd085c85866e54 /lisp/gnus/mm-view.el
parentb9015606d169d3a70c0c690e8107b894fe62b7cb (diff)
downloademacs-b6fac9aaaf21c12a25e1cbec9cb8b8d14d2dc8a8.tar.gz
verify signed content in smime encrypted and signed message
* lisp/gnus/gnus-art.el (gnus-mime-display-part): Parse pkcs7 parts (bug#40397). (gnus-mime-security-verify-or-decrypt): (gnus-insert-mime-security-button): Handle these parts. * lisp/gnus/mm-decode.el (mm-verify-function-alist): Add pkcs7 functions. (mm-decrypt-function-alist): Handle them. (mm-possibly-verify-or-decrypt): Ditto. * lisp/gnus/mm-view.el (mm-view-pkcs7-decrypt): Handle pkcs7. Changes: - structure the result of mm-dissect-buffer of application/pkcs7-mime like a multipart mail so there is no loosing of information of verification and decryption results which can now be displayed by gnus-mime-display-security - adjust gnus-mime-display-part to handle application/pkcs7-mime like multipart/encrypted or multipart/signed - add dummy entries to mm-verify-function-alist and mm-decrypt-function-alist so gnus-mime-display-security correctly displays "S/MIME" and not "unknown protocol" - don't just check for multipart/signed in gnus-insert-mime-security-button but also for the pkcs7-mime mimetypes to print "Encrypted" or "Signed" accordingly in the security button - adjust mm-possibly-verify-or-decrypt to check for smime-type to ask wether to verify or decrypt the part and not to always ask to decrypt - adjust mm-view-pkcs7-decrypt and verify to call mm-sec-status so success information can be displayed by gnus-mime-display-security - adjust gnus-mime-security-verify-or-decrypt to handle pkcs7-mime right with the done changes
Diffstat (limited to 'lisp/gnus/mm-view.el')
-rw-r--r--lisp/gnus/mm-view.el13
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/gnus/mm-view.el b/lisp/gnus/mm-view.el
index d2a6d2cf5d3..319bc745ff8 100644
--- a/lisp/gnus/mm-view.el
+++ b/lisp/gnus/mm-view.el
@@ -634,12 +634,9 @@ If MODE is not set, try to find mode automatically."
(context (epg-make-context 'CMS)))
(prog1
(epg-verify-string context part)
- (let ((result (car (epg-context-result-for context 'verify))))
+ (let ((result (epg-context-result-for context 'verify)))
(mm-sec-status
- 'gnus-info (epg-signature-status result)
- 'gnus-details
- (format "%s:%s" (epg-signature-validity result)
- (epg-signature-key-id result))))))))
+ 'gnus-info (epg-verify-result-to-string result)))))))
(with-temp-buffer
(insert "MIME-Version: 1.0\n")
(mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")
@@ -659,7 +656,11 @@ If MODE is not set, try to find mode automatically."
;; Use EPG/gpgsm
(let ((part (base64-decode-string (buffer-string))))
(erase-buffer)
- (insert (epg-decrypt-string (epg-make-context 'CMS) part)))
+ (insert
+ (let ((context (epg-make-context 'CMS)))
+ (prog1
+ (epg-decrypt-string context part)
+ (mm-sec-status 'gnus-info "OK")))))
;; Use openssl
(insert "MIME-Version: 1.0\n")
(mm-insert-headers "application/pkcs7-mime" "base64" "smime.p7m")