GNU bug report logs - #37025
27.0.50; smime signing and encryption does not work any longer

Previous Next

Package: emacs;

Reported by: Uwe Brauer <oub <at> mat.ucm.es>

Date: Wed, 14 Aug 2019 10:26:02 UTC

Severity: normal

Tags: fixed

Found in version 27.0.50

Fixed in version 27.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #23 received at 37025 <at> debbugs.gnu.org (full text, mbox):

From: Teemu Likonen <tlikonen <at> iki.fi>
To: Glenn Morris <rgm <at> gnu.org>
Cc: oub <at> mat.ucm.es, 37025 <at> debbugs.gnu.org
Subject: Re: bug#37025: [found the culprit]
Date: Thu, 15 Aug 2019 19:08:01 +0300
[Message part 1 (text/plain, inline)]
Teemu Likonen [2019-08-15T07:48:24+03] wrote:

> So there should also be version checking in epg.el's epg-start-sign
> and epg-start-encrypt functions (or somewhere).

OK. Here's a patch with version checking. This patch includes everything
in the previous patch (that is, use "--sender" only with OpenPGP
protocol) and additionally this checks if gpg is at least version 2.1.15
which introduced the "--sender" option.


diff --git a/lisp/epg.el b/lisp/epg.el
index ce58c520f1..838cf6b9ea 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -1617,8 +1617,13 @@ epg-start-sign
 				     (epg-sub-key-id
 				      (car (epg-key-sub-key-list signer)))))
 			     (epg-context-signers context)))
-                     (let ((sender (epg-context-sender context)))
-                       (when (stringp sender)
+                     (let ((sender (epg-context-sender context))
+                           (version (cdr (assq 'version (epg-find-configuration
+                                                         'OpenPGP)))))
+                       (when (and (eql 'OpenPGP (epg-context-protocol context))
+                                  (stringp version)
+                                  (version<= "2.1.15" version)
+                                  (stringp sender))
                          (list "--sender" sender)))
 		     (epg--args-from-sig-notations
 		      (epg-context-sig-notations context))
@@ -1714,9 +1719,15 @@ epg-start-encrypt
 					  (car (epg-key-sub-key-list
 						signer)))))
 				 (epg-context-signers context))))
-		     (if sign
-                         (let ((sender (epg-context-sender context)))
-                           (when (stringp sender)
+		     (if (and sign
+                              (eql 'OpenPGP (epg-context-protocol context)))
+                         (let ((sender (epg-context-sender context))
+                               (version (cdr (assq 'version
+                                                   (epg-find-configuration
+                                                    'OpenPGP)))))
+                           (when (and (stringp version)
+                                      (version<= "2.1.15" version)
+                                      (stringp sender))
                              (list "--sender" sender))))
                      (if sign
 			 (epg--args-from-sig-notations
diff --git a/lisp/gnus/mml-sec.el b/lisp/gnus/mml-sec.el
index 07d2028534..e0ec829617 100644
--- a/lisp/gnus/mml-sec.el
+++ b/lisp/gnus/mml-sec.el
@@ -915,7 +915,7 @@ mml-secure-epg-encrypt
     (when sign
       (setq signers (mml-secure-signers context signer-names))
       (setf (epg-context-signers context) signers)
-      (when mml-secure-openpgp-sign-with-sender
+      (when (and (eq 'OpenPGP protocol) mml-secure-openpgp-sign-with-sender)
         (setf (epg-context-sender context) sender)))
     (when (eq 'OpenPGP protocol)
       (setf (epg-context-armor context) t)
@@ -945,10 +945,10 @@ mml-secure-epg-sign
 	 signature micalg)
     (when (eq 'OpenPGP protocol)
       (setf (epg-context-armor context) t)
-      (setf (epg-context-textmode context) t))
+      (setf (epg-context-textmode context) t)
+      (when mml-secure-openpgp-sign-with-sender
+        (setf (epg-context-sender context) sender)))
     (setf (epg-context-signers context) signers)
-    (when mml-secure-openpgp-sign-with-sender
-      (setf (epg-context-sender context) sender))
     (when (mml-secure-cache-passphrase-p protocol)
       (epg-context-set-passphrase-callback
        context



-- 
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tlikonen <at> iki.fi
/  https://keybase.io/tlikonen  https://github.com/tlikonen
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 265 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.