From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Teemu Likonen Newsgroups: gmane.emacs.bugs Subject: bug#37025: [found the culprit] Date: Thu, 15 Aug 2019 19:08:01 +0300 Message-ID: <875zmyh0ny.fsf@iki.fi> References: <87imr06o42.fsf@mat.ucm.es> <8736i3y3uw.fsf@mat.ucm.es> <87ef1n4l1c.fsf@iki.fi> <87imqz6nl3.fsf@iki.fi> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="248731"; mail-complaints-to="usenet@blaine.gmane.org" Cc: oub@mat.ucm.es, 37025@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Aug 15 18:09:30 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyIJe-0012Qv-IL for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 18:09:30 +0200 Original-Received: from localhost ([::1]:43808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyIJd-0005Xh-6M for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 12:09:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43522) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyIJJ-0005N8-5g for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 12:09:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyIJC-0006wL-Tg for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 12:09:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyIJC-0006wD-Qs for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 12:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hyIJC-0002M7-KW for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 12:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Teemu Likonen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 15 Aug 2019 16:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37025 X-GNU-PR-Package: emacs Original-Received: via spool by 37025-submit@debbugs.gnu.org id=B37025.15658852938928 (code B ref 37025); Thu, 15 Aug 2019 16:09:02 +0000 Original-Received: (at 37025) by debbugs.gnu.org; 15 Aug 2019 16:08:13 +0000 Original-Received: from localhost ([127.0.0.1]:52318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyIIO-0002Jv-P4 for submit@debbugs.gnu.org; Thu, 15 Aug 2019 12:08:13 -0400 Original-Received: from mail.kapsi.fi ([91.232.154.25]:38857) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hyIIM-0002Jj-Nx for 37025@debbugs.gnu.org; Thu, 15 Aug 2019 12:08:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=kapsi.fi; s=20161220; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=eCT2OV/qB5yk9eUafbjfHHWiKoTIeQ2Kfb1Ve2xVlCw=; b=DB/Uvh9nzADP3G2im3XA/qEc3j DpcHHT2WyjOvS1pwYnuqeaGol+qdyclGVl0JQfKa3NrIeqdyXIt3D/YM7uW/J8sWHLUTmrcg1gybi poj+vJSdnT25hwvshF1PKcmsXiwK5E1YojpBe1mzcj0zk3thq/F+082aJFc8zpgtrpdFVRmfBR59K 6/pluMYxC1aHDXwQBvTbRNu5R5FBcsaiGk0xhGwaNv01egZ7J7jWP9yg/ozAlx1S+RJMALBM61j5l 3P6FBbfcb48iesSRA1ufMnCZN6UKtLkbj683+eznHWjulmsfnti6+Kw76ZuKMN6nrpEQ4zotzdZPP fw/23yDw==; Original-Received: from mobile-access-bcee81-196.dhcp.inet.fi ([188.238.129.196] helo=mithlond) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hyIIK-0001iE-Hi; Thu, 15 Aug 2019 19:08:08 +0300 In-Reply-To: <87imqz6nl3.fsf@iki.fi> X-SA-Exim-Connect-IP: 188.238.129.196 X-SA-Exim-Mail-From: tlikonen@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:165120 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable 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 =2D-- 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))) =2D (let ((sender (epg-context-sender context))) =2D (when (stringp sender) + (let ((sender (epg-context-sender context)) + (version (cdr (assq 'version (epg-find-configur= ation + 'OpenPGP))))) + (when (and (eql 'OpenPGP (epg-context-protocol cont= ext)) + (stringp version) + (version<=3D "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)))) =2D (if sign =2D (let ((sender (epg-context-sender context))) =2D (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<=3D "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 =2D-- 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) =2D (when mml-secure-openpgp-sign-with-sender + (when (and (eq 'OpenPGP protocol) mml-secure-openpgp-sign-with-sende= r) (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) =2D (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) =2D (when mml-secure-openpgp-sign-with-sender =2D (setf (epg-context-sender context) sender)) (when (mml-secure-cache-passphrase-p protocol) (epg-context-set-passphrase-callback context =2D-=20 /// OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450 // https://keys.openpgp.org/search?q=3Dtlikonen@iki.fi / https://keybase.io/tlikonen https://github.com/tlikonen --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFEBAEBCAAuFiEEkhZiiC54Bnj5a16Skzo1BB5+rVEFAl1Vg2EQHHRsaWtvbmVu QGlraS5maQAKCRCTOjUEHn6tUQGCB/sFmkDWV5HLlpJTS0vOXX8vboGI2pyoKdNh hqF2Ejn3w1s/SaNHoWC4qVGMXL4DxcXjbHxwFz+sGXV/HXr3AZiQlLMpCWJKK80U i/y/WviQ2ixBo3MgdlKYBIIZdrIlKMvE4gIfslL0U4HrQ2l4AFQi2mZTZostsWU3 6KFzP5hT0MsO92zPY117rCfSD+yy4InAy84xTJMaMSwS38VJMKSY6xx9GvUsHM/Q msZ+ODLMjpNUKOcTlK4+zRimWLkuNQJ9P+U69QqMpcbJSf/coCnVySc42zYPHdTe rZxsMYPzIinEeu85qKdUqxnNXddwy7meZP7E57pAeGubYamYbFzoiIYEARYIAC4W IQTJW2wqtelxC1gHdbitnXWr7pTCcwUCXVWDZxAcdGxpa29uZW5AaWtpLmZpAAoJ EK2ddavulMJzyQEA/1M1zV94AofZnUXF3Zu/gL1EydHl6fhWpvbfLeKig60pAPwL aNACe7pNnExyApH1bD4mbErA5nUXrPT58ypJ0azNDA== =1cX+ -----END PGP SIGNATURE----- --=-=-=--