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 07:48:24 +0300 Message-ID: <87imqz6nl3.fsf@iki.fi> References: <87imr06o42.fsf@mat.ucm.es> <8736i3y3uw.fsf@mat.ucm.es> <87ef1n4l1c.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="112029"; 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 06:49:12 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 1hy7hH-000T1f-Ok for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 06:49:11 +0200 Original-Received: from localhost ([::1]:38382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hy7hG-0004JG-9Q for geb-bug-gnu-emacs@m.gmane.org; Thu, 15 Aug 2019 00:49:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38714) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hy7h9-0004J9-S0 for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 00:49:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hy7h8-0002vA-LF for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 00:49:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41534) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hy7h8-0002uw-IE for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 00:49:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hy7h8-0003LK-Db for bug-gnu-emacs@gnu.org; Thu, 15 Aug 2019 00:49: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 04:49: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.156584451612817 (code B ref 37025); Thu, 15 Aug 2019 04:49:02 +0000 Original-Received: (at 37025) by debbugs.gnu.org; 15 Aug 2019 04:48:36 +0000 Original-Received: from localhost ([127.0.0.1]:50355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy7gi-0003Kf-FZ for submit@debbugs.gnu.org; Thu, 15 Aug 2019 00:48:36 -0400 Original-Received: from mail.kapsi.fi ([91.232.154.25]:52369) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hy7gg-0003KV-9E for 37025@debbugs.gnu.org; Thu, 15 Aug 2019 00:48:35 -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=uHFxWFFZ8KFG7CdZs4spvSRdo33xrJ1BnCjnR2LF5ak=; b=gEzLZMKQAbIT5qc2Z8w1U6kE0G 12J8Jaf+WvgUASTtg5dM8l9xzFHHDD9T78JizCxGLnCn98XzyXGansBDmYVj3Jxa4qrebnr44/SZY tHN1vIDZDXIJKAF6TOcAM4IN6G7pLP+jLnfiqlfNu/iHudLEIq9nfEUP1VuwDH2CFWh15KpD1e/eg OkeeoObWTMqlOSNZcyxF5kj4At9FzLJaf63ear9tk/JhhpfHwOuQDV1p+xiuoV1NvY2Y5EFDO7BWZ x14K/YSov3fkL2OsrEsZeH5ZsT8oCCqF3aqGhWASpMjZVHB6hmMbLJKjD/wyrWSjaR46olGHDsnsp BInWur4g==; Original-Received: from mobile-access-bceef8-36.dhcp.inet.fi ([188.238.248.36] helo=mithlond) by mail.kapsi.fi with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hy7gd-0003Lp-2O; Thu, 15 Aug 2019 07:48:31 +0300 In-Reply-To: X-SA-Exim-Connect-IP: 188.238.248.36 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:165044 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Glenn Morris [2019-08-14T21:39:37-04] wrote: > Teemu Likonen wrote: >> Thanks for the report and bisecting. I think we can fix the bug by >> including "--sender" option only with openpgp protocol (i.e. gpg). Because --sender is an OpenPGP thing (gpg) it is logical to narrow its use to that protocol only. Here's the first fix: diff --git i/lisp/epg.el w/lisp/epg.el index ce58c520f1..905440d183 100644 =2D-- i/lisp/epg.el +++ w/lisp/epg.el @@ -1618,7 +1618,8 @@ epg-start-sign (car (epg-key-sub-key-list signer))))) (epg-context-signers context))) (let ((sender (epg-context-sender context))) =2D (when (stringp sender) + (when (and (eql 'OpenPGP (epg-context-protocol cont= ext)) + (stringp sender)) (list "--sender" sender))) (epg--args-from-sig-notations (epg-context-sig-notations context)) @@ -1714,7 +1715,8 @@ epg-start-encrypt (car (epg-key-sub-key-list signer))))) (epg-context-signers context)))) =2D (if sign + (if (and sign + (eql 'OpenPGP (epg-context-protocol context)= )) (let ((sender (epg-context-sender context))) (when (stringp sender) (list "--sender" sender)))) diff --git i/lisp/gnus/mml-sec.el w/lisp/gnus/mml-sec.el index 07d2028534..e0ec829617 100644 =2D-- i/lisp/gnus/mml-sec.el +++ w/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 > gpg --sender > -> gpg: invalid option "--sender" # RHEL 7.6 with gpg 2.0.22 > > The option seems to only by present since gpg 2.1.15. > https://gnupg.org/download/release_notes.html > > Ideally you should test if it is supported or not. So there should also be version checking in epg.el's epg-start-sign and epg-start-encrypt functions (or somewhere). Currently I don't know if there are useful infrastructure in epg for dealing with different versions of gpg. =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+rVEFAl1U5BgQHHRsaWtvbmVu QGlraS5maQAKCRCTOjUEHn6tUZccB/9pxhA4z+eX3hYsn9j+BuHz6tpnhIWYKlqv FglUz2e4eDt4pQp4fo0aX5QqjXYMPxsuVDwciobOMQGI9aaCUIjbGyDY4IVgJdfD AbunUrjDsn/IKeROmJSN1h3wHoYJ8engaMi9PtzF1E129+UGJTdUf7mswxPfCwen zUYrv6eqsdh044mK2QgmQ/Ea1zAKTWqkObjKqf/hQISqbBIe05742L/l+0cNJrul slDij54mcJ5A2fN0bzhYTC3CGw2LHiw6qSuRKlv+mSdM2dbxyhtye7xaNbuCiYSC ECAC+zvpAEd42QgD76lCFjREGkTaUheNYb0XYjo9te95ZdtHyLPmiIYEARYIAC4W IQTJW2wqtelxC1gHdbitnXWr7pTCcwUCXVTkHhAcdGxpa29uZW5AaWtpLmZpAAoJ EK2ddavulMJzkV8BAPQ0wmq1fFAy4CL4IqPetIb8fgVl7HSj0vX0CEKLH8T0AQCB gPZs/DIKJSE9/BL/axufiL9qnsbHst8zfQi9dqijAg== =9Jwn -----END PGP SIGNATURE----- --=-=-=--