From 5d33839c3fc40308cd29dbd0991888ead81fbfa7 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 30 Sep 2019 08:41:43 +0200 Subject: [PATCH] Refactor mm-decode and friends to be explicit about when errors happen * lisp/gnus/mm-decode.el (mm-sec-status): (mm-sec-error): New functions to handle decryption problems more explicitly (bug#18393). (mm-possibly-verify-or-decrypt): Use the `sec-error' data to determine whether the operation failed or not. * lisp/gnus/mml-smime.el: Ditto. * lisp/gnus/mml2015.el: Used throughout. --- lisp/gnus/mm-decode.el | 34 ++++--- lisp/gnus/mm-uu.el | 4 +- lisp/gnus/mml-smime.el | 42 ++++---- lisp/gnus/mml2015.el | 215 ++++++++++++++++------------------------- 4 files changed, 123 insertions(+), 172 deletions(-) diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 3de7a0464bb..22e7e118e2e 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1646,14 +1646,22 @@ If RECURSIVE, search recursively." (setq result (buffer-string)))))) result)) -(defvar mm-security-handle nil) - (defsubst mm-set-handle-multipart-parameter (handle parameter value) ;; HANDLE could be a CTL. (when handle (put-text-property 0 (length (car handle)) parameter value (car handle)))) +;; Interface functions and variables for the decryption/verification +;; functions. +(defvar mm-security-handle nil) +(defun mm-sec-status (&rest keys) + (cl-loop for (key val) on keys by #'cddr + do (mm-set-handle-multipart-parameter mm-security-handle key val))) + +(defun mm-sec-error (&rest keys) + (apply #'mm-sec-status (append '(sec-error t) keys))) + (autoload 'mm-view-pkcs7 "mm-view") (defun mm-possibly-verify-or-decrypt (parts ctl &optional from) @@ -1706,9 +1714,8 @@ If RECURSIVE, search recursively." (save-excursion (if func (setq parts (funcall func parts ctl)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details - (format "Unknown sign protocol (%s)" protocol)))))) + (mm-sec-error 'gnus-details + (format "Unknown sign protocol (%s)" protocol)))))) ((equal subtype "encrypted") (unless (setq protocol (mm-handle-multipart-ctl-parameter ctl 'protocol)) @@ -1738,22 +1745,23 @@ If RECURSIVE, search recursively." (save-excursion (if func (setq parts (funcall func parts ctl)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-error + 'gnus-details (format "Unknown encrypt protocol (%s)" protocol))))))) ;; Check the results (which are now in `parts'). - (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) - (if (or (not info) - (equal info "") - (not (equal subtype "encrypted")) - (member "OK" (split-string info "\n"))) + (let ((err (get-text-property 0 'sec-error (car mm-security-handle)))) + (if (or (not err) + (not (equal subtype "encrypted"))) parts ;; We had an error during decryption. Report what it is. (list (mm-make-handle (with-current-buffer (generate-new-buffer " *mm*") (insert "Error! Result from decryption:\n\n" - info "\n\n" + (or (get-text-property 0 'gnus-details + (car mm-security-handle)) + "") + "\n\n" (or (get-text-property 0 'gnus-details (car mm-security-handle)) "")) diff --git a/lisp/gnus/mm-uu.el b/lisp/gnus/mm-uu.el index a00d64015f2..6143b41bbc1 100644 --- a/lisp/gnus/mm-uu.el +++ b/lisp/gnus/mm-uu.el @@ -509,8 +509,8 @@ apply the face `mm-uu-extract'." 'iso-8859-1))) (funcall (mml2015-clear-verify-function)))) (when (and mml2015-use (null (mml2015-clear-verify-function))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mml2015--status + 'gnus-details (format-message "Clear verification not supported by `%s'.\n" mml2015-use))) (mml2015-extract-cleartext-signature)) diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el index b2e9b783522..659f2b95289 100644 --- a/lisp/gnus/mml-smime.el +++ b/lisp/gnus/mml-smime.el @@ -274,10 +274,9 @@ Whether the passphrase is cached at all is controlled by (if (not good-signature) (progn ;; we couldn't verify message, fail with openssl output as message - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-error + 'gnus-info "Failed" + 'gnus-details (concat "OpenSSL failed to verify message integrity:\n" "-------------------------------------------\n" openssl-output))) @@ -290,19 +289,18 @@ Whether the passphrase is cached at all is controlled by (while (re-search-forward "-----END CERTIFICATE-----" nil t) (when (smime-pkcs7-email-region (point-min) (point)) (setq addresses (append (smime-buffer-as-string-region - (point-min) (point)) addresses))) + (point-min) (point)) + addresses))) (delete-region (point-min) (point))) (setq addresses (mapcar 'downcase addresses)))) - (if (not (member (downcase (or (mm-handle-multipart-from ctl) "")) addresses)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Sender address forged") + (if (not (member (downcase (or (mm-handle-multipart-from ctl) "")) + addresses)) + (mm-sec-error 'gnus-info "Sender address forged") (if good-certificate - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Ok (sender authenticated)") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Ok (sender not trusted)"))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-status 'gnus-info "Ok (sender authenticated)") + (mm-sec-status 'gnus-info "Ok (sender not trusted)"))) + (mm-sec-status + 'gnus-details (concat "Sender claimed to be: " (mm-handle-multipart-from ctl) "\n" (if addresses (concat "Addresses in certificate: " @@ -411,24 +409,20 @@ Content-Disposition: attachment; filename=smime.p7m (cdr handle) "application/x-pkcs7-signature" nil t))))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (setq part (replace-regexp-in-string "\n" "\r\n" part) context (epg-make-context 'CMS)) (condition-case error (setq plain (epg-verify-string context (mm-get-part signature) part)) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (if (eq (car error) 'quit) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (format "%S" error))) + (mm-sec-status 'gnus-details "Quit.") + (mm-sec-status 'gnus-details (format "%S" error))) (throw 'error handle))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-status + 'gnus-info (epg-verify-result-to-string (epg-context-result-for context 'verify))) handle))) diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 45164ee8f65..c3cf31f1a3c 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -191,8 +191,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (unless (setq child (mm-find-part-by-type (cdr handle) "application/octet-stream" nil t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (with-temp-buffer (mm-insert-part child) @@ -200,21 +199,18 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (condition-case err (funcall mml2015-decrypt-function) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil))) (unless (car result) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (throw 'error handle)) (setq handles (mm-dissect-buffer t))) (mm-destroy-parts handle) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-status + 'gnus-info (concat "OK" (let ((sig (with-current-buffer mml2015-result-buffer (mml2015-gpg-extract-signature-details)))) @@ -281,18 +277,14 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (condition-case err (funcall mml2015-decrypt-function) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil))) (if (car result) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed")))) + (mm-sec-status 'gnus-info "OK") + (mm-sec-error 'gnus-info "Failed")))) (defun mml2015-fix-micalg (alg) (and alg @@ -309,8 +301,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." ctl 'protocol) "application/pgp-signature") t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (with-temp-buffer (insert "-----BEGIN PGP SIGNED MESSAGE-----\n") @@ -329,8 +320,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (forward-line))) (unless (setq part (mm-find-part-by-type (cdr handle) "application/pgp-signature" nil t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (save-restriction (narrow-to-region (point) (point)) @@ -345,8 +335,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (prog1 (funcall mml2015-verify-function) (if (get-buffer " *mailcrypt stderr temp") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-error + 'gnus-details (with-current-buffer " *mailcrypt stderr temp" (buffer-string)))) (if (get-buffer " *mailcrypt stdout temp") @@ -358,18 +348,14 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (if (get-buffer mc-gpg-debug-buffer) (kill-buffer mc-gpg-debug-buffer))) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (throw 'error handle)))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK") + (mm-sec-status 'gnus-info "OK") handle))) (defun mml2015-mailcrypt-clear-verify () @@ -378,8 +364,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (prog1 (funcall mml2015-verify-function) (if (get-buffer " *mailcrypt stderr temp") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-error + 'gnus-details (with-current-buffer " *mailcrypt stderr temp" (buffer-string)))) (if (get-buffer " *mailcrypt stdout temp") @@ -391,17 +377,13 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (if (get-buffer mc-gpg-debug-buffer) (kill-buffer mc-gpg-debug-buffer))) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed"))) + (mm-sec-status 'gnus-info "OK") + (mm-sec-error 'gnus-info "Failed"))) (mml2015-extract-cleartext-signature)) (defun mml2015-mailcrypt-sign (cont) @@ -509,8 +491,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (unless (setq child (mm-find-part-by-type (cdr handle) "application/octet-stream" nil t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (with-temp-buffer (mm-insert-part child) @@ -520,16 +501,12 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (setq decrypt-status (with-current-buffer mml2015-result-buffer (buffer-string))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details - decrypt-status)) + (mm-sec-status 'gnus-details decrypt-status)) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil)) (with-current-buffer pgg-output-buffer (goto-char (point-min)) @@ -537,27 +514,24 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (replace-match "\n" t t)) (setq handles (mm-dissect-buffer t)) (mm-destroy-parts handle) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details - (concat decrypt-status - (when (stringp (car handles)) - "\n" (mm-handle-multipart-ctl-parameter - handles 'gnus-details)))) + (mm-sec-status 'gnus-info "OK" + 'gnus-details + (concat decrypt-status + (when (stringp (car handles)) + "\n" (mm-handle-multipart-ctl-parameter + handles 'gnus-details)))) (if (listp (car handles)) handles (list handles))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (throw 'error handle)))))) (defun mml2015-pgg-clear-decrypt () (let ((pgg-errors-buffer mml2015-result-buffer)) (if (prog1 (pgg-decrypt-region (point-min) (point-max)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-status + 'gnus-details (with-current-buffer mml2015-result-buffer (buffer-string)))) (progn @@ -568,10 +542,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n" t t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK")) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed")))) + (mm-sec-status 'gnus-info "OK")) + (mm-sec-error 'gnus-info "Failed")))) (defun mml2015-pgg-verify (handle ctl) (let ((pgg-errors-buffer mml2015-result-buffer) @@ -581,11 +553,11 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." ctl 'protocol) "application/pgp-signature") t))) - (null (setq signature (mm-find-part-by-type - (cdr handle) "application/pgp-signature" nil t)))) + (null (setq signature + (mm-find-part-by-type + (cdr handle) "application/pgp-signature" nil t)))) (progn - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") handle) (with-temp-buffer (insert part) @@ -607,29 +579,26 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n" t t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-status + 'gnus-details (concat (with-current-buffer pgg-output-buffer (buffer-string)) (with-current-buffer pgg-errors-buffer (buffer-string))))) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil)) (progn (delete-file signature-file) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-error + 'gnus-info (with-current-buffer pgg-errors-buffer (mml2015-gpg-extract-signature-details)))) (delete-file signature-file) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed"))))) + (mm-sec-error 'gnus-info "Failed"))))) handle) (defun mml2015-pgg-clear-verify () @@ -644,26 +613,23 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n" t t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-status + 'gnus-details (concat (with-current-buffer pgg-output-buffer (buffer-string)) (with-current-buffer pgg-errors-buffer (buffer-string))))) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error err)) + (mm-sec-error 'gnus-details (mml2015-format-error err)) nil) (quit - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") + (mm-sec-error 'gnus-details "Quit.") nil)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-status + 'gnus-info (with-current-buffer pgg-errors-buffer (mml2015-gpg-extract-signature-details))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed"))) + (mm-sec-error 'gnus-info "Failed"))) (mml2015-extract-cleartext-signature)) (defun mml2015-pgg-sign (cont) @@ -807,8 +773,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (unless (setq child (mm-find-part-by-type (cdr handle) "application/octet-stream" nil t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (setq context (epg-make-context)) (if (or mml2015-cache-passphrase mml-secure-cache-passphrase) @@ -820,13 +785,10 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." mml-secure-secret-key-id-list nil) (error (mml-secure-clear-secret-key-id-list) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (if (eq (car error) 'quit) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error error))) + (mm-sec-status 'gnus-details "Quit.") + (mm-sec-status 'gnus-details (mml2015-format-error error))) (throw 'error handle))) (with-temp-buffer (insert plain) @@ -836,16 +798,15 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (setq handles (mm-dissect-buffer t)) (mm-destroy-parts handle) (if (epg-context-result-for context 'verify) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-status + 'gnus-info (concat "OK\n" (mml2015-epg-verify-result-to-string (epg-context-result-for context 'verify)))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK")) + (mm-sec-status 'gnus-info "OK")) (if (stringp (car handles)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-status + 'gnus-details (mm-handle-multipart-ctl-parameter handles 'gnus-details)))) (if (listp (car handles)) handles @@ -864,13 +825,10 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." mml-secure-secret-key-id-list nil) (error (mml-secure-clear-secret-key-id-list) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (if (eq (car error) 'quit) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error error))))) + (mm-sec-status 'gnus-details "Quit.") + (mm-sec-status 'gnus-details (mml2015-format-error error))))) (when plain (erase-buffer) ;; Treat data which epg returns as a unibyte string. @@ -879,11 +837,10 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (goto-char (point-min)) (while (search-forward "\r\n" nil t) (replace-match "\n" t t)) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "OK") + (mm-sec-status 'gnus-info "OK") (if (epg-context-result-for context 'verify) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details + (mm-sec-status + 'gnus-details (mml2015-epg-verify-result-to-string (epg-context-result-for context 'verify))))))) @@ -899,8 +856,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (null (setq signature (mm-find-part-by-type (cdr handle) "application/pgp-signature" nil t)))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Corrupted") + (mm-sec-error 'gnus-info "Corrupted") (throw 'error handle)) (setq part (replace-regexp-in-string "\n" "\r\n" part) signature (mm-get-part signature) @@ -908,16 +864,12 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (condition-case error (setq plain (epg-verify-string context signature part)) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (if (eq (car error) 'quit) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error error))) + (mm-sec-status 'gnus-details "Quit.") + (mm-sec-status 'gnus-details (mml2015-format-error error))) (throw 'error handle))) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-status 'gnus-info (mml2015-epg-verify-result-to-string (epg-context-result-for context 'verify))) handle))) @@ -931,17 +883,14 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (condition-case error (setq plain (epg-verify-string context signature)) (error - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info "Failed") + (mm-sec-error 'gnus-info "Failed") (if (eq (car error) 'quit) - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details "Quit.") - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-details (mml2015-format-error error))))) + (mm-sec-status 'gnus-details "Quit.") + (mm-sec-status 'gnus-details (mml2015-format-error error))))) (if plain (progn - (mm-set-handle-multipart-parameter - mm-security-handle 'gnus-info + (mm-sec-status + 'gnus-info (mml2015-epg-verify-result-to-string (epg-context-result-for context 'verify))) (delete-region (point-min) (point-max)) -- 2.39.2