diff options
| author | Lars Ingebrigtsen | 2019-09-23 18:23:22 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-09-23 18:23:22 +0200 |
| commit | 4ce81556b7ad7f7f8c8bb07a7a935114bbe850d0 (patch) | |
| tree | b39d7958a528c16856f1610235b6174e17c14ab7 /lisp | |
| parent | babc595909922201ca92f1bbcc03ae6b7964c1a9 (diff) | |
| download | emacs-4ce81556b7ad7f7f8c8bb07a7a935114bbe850d0.tar.gz emacs-4ce81556b7ad7f7f8c8bb07a7a935114bbe850d0.zip | |
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).
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/gnus/mm-decode.el | 18 |
1 files changed, 15 insertions, 3 deletions
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." | |||
| 1738 | (setq parts (funcall func parts ctl)) | 1738 | (setq parts (funcall func parts ctl)) |
| 1739 | (mm-set-handle-multipart-parameter | 1739 | (mm-set-handle-multipart-parameter |
| 1740 | mm-security-handle 'gnus-details | 1740 | mm-security-handle 'gnus-details |
| 1741 | (format "Unknown encrypt protocol (%s)" protocol)))))) | 1741 | (format "Unknown encrypt protocol (%s)" protocol))))))) |
| 1742 | (t nil)) | 1742 | (let ((info (get-text-property 0 'gnus-info (car mm-security-handle)))) |
| 1743 | parts)) | 1743 | (if (or (not info) |
| 1744 | (member "OK" (split-string info "\n"))) | ||
| 1745 | parts | ||
| 1746 | ;; We had an error during decryption. Report what it is. | ||
| 1747 | (list | ||
| 1748 | (mm-make-handle | ||
| 1749 | (with-current-buffer (generate-new-buffer " *mm*") | ||
| 1750 | (insert "Error! Result from decryption:\n\n" | ||
| 1751 | info "\n\n" | ||
| 1752 | (get-text-property 0 'gnus-details | ||
| 1753 | (car mm-security-handle))) | ||
| 1754 | (current-buffer)) | ||
| 1755 | '("text/plain"))))))) | ||
| 1744 | 1756 | ||
| 1745 | (defun mm-multiple-handles (handles) | 1757 | (defun mm-multiple-handles (handles) |
| 1746 | (and (listp handles) | 1758 | (and (listp handles) |