From ef2059e877d104bfe5abd24df05bb09c7295e4fa Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 12 Apr 2018 00:05:27 +0200 Subject: [PATCH] Give better errors in signing failures in Gnus * lisp/gnus/mml1991.el (mml1991-epg-sign): Give better error messages when signing fails (bug#26298). * lisp/gnus/mml2015.el (mml2015-epg-sign): Ditto. --- lisp/gnus/mml1991.el | 2 ++ lisp/gnus/mml2015.el | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lisp/gnus/mml1991.el b/lisp/gnus/mml1991.el index 93b1b5049a8..b2056b2fd0d 100644 --- a/lisp/gnus/mml1991.el +++ b/lisp/gnus/mml1991.el @@ -275,6 +275,8 @@ Whether the passphrase is cached at all is controlled by (mm-decode-content-transfer-encoding cte))) (let* ((pair (mml-secure-epg-sign 'OpenPGP 'clear)) (signature (car pair))) + (unless (stringp signature) + (error "Signature failed")) (delete-region (point-min) (point-max)) (insert (with-temp-buffer diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 5980ddb38fe..403b5e1af6a 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -958,6 +958,8 @@ If set, it overrides the setting of `mml2015-sign-with-sender'." (let* ((pair (mml-secure-epg-sign 'OpenPGP t)) (signature (car pair)) (micalg (cdr pair))) + (unless (stringp signature) + (error "Signature failed")) (goto-char (point-min)) (insert (format "Content-Type: multipart/signed; boundary=\"%s\";\n" boundary)) -- 2.39.5