[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 59243e9 3/4: Fix two mml-sec minor bugs revealed by new test harn
master 59243e9 3/4: Fix two mml-sec minor bugs revealed by new test harness
Tue, 4 Aug 2020 13:29:01 -0400 (EDT)
Author: Lars Ingebrigtsen <email@example.com>
Commit: Lars Ingebrigtsen <firstname.lastname@example.org>
Fix two mml-sec minor bugs revealed by new test harness
(mml-secure-allow-signing-with-unknown-recipient): New variable
(bug#18393) (but this should probably be fixed in a different way).
(mml-secure-epg-sign): Use it.
(mml-secure-check-user-id): Protect against recipients that aren't
email addresses, like "No recipient".
lisp/gnus/mml-sec.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 740e1d2..69852c3 100644
@@ -665,8 +665,9 @@ The passphrase is read and cached."
(equal (downcase (car (mail-header-parse-address
- (downcase (car (mail-header-parse-address
+ (downcase (or (car (mail-header-parse-address
(not (memq (epg-user-id-validity uid)
(throw 'break t))))))
@@ -937,6 +938,10 @@ If no one is selected, symmetric encryption will be
(signal (car error) (cdr error))))
+;; Should probably be removed and the interface should be different.
+(defvar mml-secure-allow-signing-with-unknown-recipient nil
+ "Variable to bind to allow automatic recipient selection.")
(defun mml-secure-epg-sign (protocol mode)
;; Based on code appearing inside mml2015-epg-sign.
(let* ((context (epg-make-context protocol))
@@ -953,7 +958,8 @@ If no one is selected, symmetric encryption will be
;; then there's no point advising the user to examine it. If
;; there are any other variables worth examining, please
;; improve this error message by having it mention them.
- (error "Couldn't find any signer names%s" maybe-msg)))
+ (unless mml-secure-allow-signing-with-unknown-recipient
+ (error "Couldn't find any signer names%s" maybe-msg))))
(when (eq 'OpenPGP protocol)
(setf (epg-context-armor context) t)
(setf (epg-context-textmode context) t)