From: Lars Ingebrigtsen Date: Mon, 23 Sep 2019 16:23:22 +0000 (+0200) Subject: Make mm-possibly-verify-or-decrypt pass decryption error X-Git-Tag: emacs-27.0.90~1467 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4ce81556b7ad7f7f8c8bb07a7a935114bbe850d0;p=emacs.git Make mm-possibly-verify-or-decrypt pass decryption error * lisp/gnus/mm-decode.el (mm-possibly-verify-or-decrypt): If there's an error, report the error back in a new part (bug#25649). --- diff --git a/lisp/gnus/mm-decode.el b/lisp/gnus/mm-decode.el index 5636b8eca47..b6e2a68d556 100644 --- a/lisp/gnus/mm-decode.el +++ b/lisp/gnus/mm-decode.el @@ -1738,9 +1738,21 @@ If RECURSIVE, search recursively." (setq parts (funcall func parts ctl)) (mm-set-handle-multipart-parameter mm-security-handle 'gnus-details - (format "Unknown encrypt protocol (%s)" protocol)))))) - (t nil)) - parts)) + (format "Unknown encrypt protocol (%s)" protocol))))))) + (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) + (if (or (not info) + (member "OK" (split-string info "\n"))) + 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" + (get-text-property 0 'gnus-details + (car mm-security-handle))) + (current-buffer)) + '("text/plain"))))))) (defun mm-multiple-handles (handles) (and (listp handles)