From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Luca Capello Newsgroups: gmane.emacs.bugs Subject: bug#7797: 24.0.50; [EasyPG/Gnus] always pick up the first key from `gpg --list-key $SENDER` Date: Fri, 07 Jan 2011 11:17:57 +0100 Message-ID: <87r5cpow4q.fsf@gismo.pca.it> References: <874o9lehkl.fsf@gismo.pca.it> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Trace: dough.gmane.org 1294395863 4469 80.91.229.12 (7 Jan 2011 10:24:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 7 Jan 2011 10:24:23 +0000 (UTC) Cc: 7797@debbugs.gnu.org, Ashish SHUKLA , Daniel Dehennin , rfrancoise@debian.org To: Daiki Ueno Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jan 07 11:24:09 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Pb9UN-00059e-6A for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Jan 2011 11:24:07 +0100 Original-Received: from localhost ([127.0.0.1]:58318 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pb9UM-0006uC-82 for geb-bug-gnu-emacs@m.gmane.org; Fri, 07 Jan 2011 05:24:06 -0500 Original-Received: from [140.186.70.92] (port=52621 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pb9UF-0006u5-Uv for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2011 05:24:01 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pb9UD-0007wB-W4 for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2011 05:23:59 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35649) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pb9UD-0007w4-Sw for bug-gnu-emacs@gnu.org; Fri, 07 Jan 2011 05:23:57 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Pb9Hi-0004Eb-LE; Fri, 07 Jan 2011 05:11:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Luca Capello Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Fri, 07 Jan 2011 10:11:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 7797 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: Original-Received: via spool by 7797-submit@debbugs.gnu.org id=B7797.129439505816261 (code B ref 7797); Fri, 07 Jan 2011 10:11:02 +0000 Original-Received: (at 7797) by debbugs.gnu.org; 7 Jan 2011 10:10:58 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pb9Hd-0004ED-Mw for submit@debbugs.gnu.org; Fri, 07 Jan 2011 05:10:58 -0500 Original-Received: from [151.1.160.141] (helo=clio.genesi.eu) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pb9Hb-0004Dy-2H; Fri, 07 Jan 2011 05:10:56 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by clio.genesi.eu (Postfix) with ESMTP id 7EBA3DF569; Fri, 7 Jan 2011 11:18:10 +0100 (CET) X-Virus-Scanned: amavisd-new at genesi.eu Original-Received: from clio.genesi.eu ([127.0.0.1]) by localhost (clio.genesi.eu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ug9cBrrDRQfe; Fri, 7 Jan 2011 11:18:10 +0100 (CET) Original-Received: from mantissa.pca.it (ip-85-135.sn2.eutelia.it [83.211.85.135]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by clio.genesi.eu (Postfix) with ESMTPS id 1E98CDF568; Fri, 7 Jan 2011 11:18:10 +0100 (CET) Original-Received: from gismo.pca.it (unknown [129.194.56.110]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by mantissa.pca.it (Postfix) with ESMTPSA id A18D222186; Fri, 7 Jan 2011 11:18:08 +0100 (CET) Original-Received: by gismo.pca.it (Postfix, from userid 1000) id 3FE152BFCE; Fri, 7 Jan 2011 11:18:06 +0100 (CET) In-Reply-To: (Daiki Ueno's message of "Fri, 07 Jan 2011 18:34:59 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Fri, 07 Jan 2011 05:11:02 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:43177 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable reopen 7797 thanks Hi Daiki! On Fri, 07 Jan 2011 10:34:59 +0100, Daiki Ueno wrote: > Daiki Ueno writes: > >> Luca Capello writes: >> >>> gpg: skipped "8D3867D89DDB992B": unusable secret key >>> gpg: signing failed: unusable secret key >> >> You may want to try the patch I posted last month: >> http://lists.gnu.org/archive/html/emacs-devel/2010-12/msg00624.html Thank you for the link, I was quite disappointed no one reported it on the GNU BTS. I added both Ashish and Daniel to the cc:, discussion requested below. >> Although this patch is a workaround, I'm going to push it for the time >> being. > > OK, I fixed this in a better way (r102771). Please, can you post it here, so I do not have to download the bzr repository? The Savannah bzr repository is disabled and the Launhpad one does not have it yet. > My test case is: > > $ mv .gnupg .gnupg.bak > $ gpg --gen-key # create a key foo@example.com > $ gpg --gen-key # create a key bar@example.com > $ gpg --gen-key # create a key baz@example.com > $ gpg --edit-key foo@example.com # revoke foo@example.com > $ gpg --delete-secret-key bar@example.com > > (mml2015-epg-find-usable-secret-key > (epg-make-context 'OpenPGP) "foo@example.com" 'sign) > =3D> nil > (mml2015-epg-find-usable-secret-key > (epg-make-context 'OpenPGP) "bar@example.com" 'sign) > =3D> nil > (mml2015-epg-find-usable-secret-key > (epg-make-context 'OpenPGP) "baz@example.com" 'sign) > =3D> (epg-key . ...) I am sorry, but I still think this is not the correct solution, thus I reopened the bug (control server bcc:ed). I think the cases should be the following, which I have (sort of) explained in my first post and it is similar to Ashish's one at: 1) by default, EasyPG does not pass any key-id to GnuPG, simply relying on ~/.gnupg/gpg.conf. After all, GnuPG configuration is done there, and *by default* all the other programs working with GnuPG should obey that configuration. And this is how I read `mm-sign-option': Option how to create signed parts. nil, use the default keys without asking; `guided', let you select signing keys from the menu. However, `mm-encrypt-option' contains the real behavior according to the code: Option of creating encrypted parts. nil, use the first public-key matching the "From:" header as the recipient; `guided', ask user to select recipient keys from the menu. =20=20=20 2) if `mml2015-signers' is set, it overrides point 1. BTW1, the documentation for that variable should be corrected: AFAIK you can set it to multiple keys, which means that the documentation should read "A list of your own key ID(s)...", note the plural. BTW2, this variable is not mentioned in any file in the doc/ folder, which is another bug. 3) introduce a new `mml2015-use-from-address' variable: - if set, it then acts like the way you explain above. - if not set, nothing changes WRT to points 1 and 2. 4) introduce also a new `mml2015-default-user-id' variable, which, if set, overrides *everything* from the above, similar to `pgg-default-user-id' reported by Ashish at the link above. I would have wanted to reply only after having implemented my solution, but since I am quite busy right now (and I will be for the whole next week as well), it is better to put here my ideas *now*. For this reason, I have probably missed something of the whole situation, thus please forgive me. Thx, bye, Gismo / Luca --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBCgAGBQJNJuhWAAoJENkdV6A76fNtV40P/jKrDJbytfdo2LyjEgsXnbtX OLWteYL/CSNdUYHC8sdQ8Yc4FlIfXWAyENt4zuao1ksmHi1q/gn7243fahHdeAAJ B5nVbcuV3eHvqWAZ0maJjE7rtGgujnFRXY5jC3B5oKsQEN1rnd/A9+LP4Uvf9PCO +nPK6sAus9HwBgHmxt74ZS4MSlWNNCFwFq3iv9oYUAeaAZdG9fdZ2YZSE0wHyDNQ 5LWYAeddNTKnz230R2uM23T0s2Xg8lG6yXbMuVm+lcE5F91eNy4qSy3OXX8qeyma aBiKo7nwZXbUTVg0QOTAkpNrzxEPYWY5O/ZqgcTSixueEfSC/NFt0BUx+zq53jjb kwW6udvL8gyZ/oBb/0KMY6SfW/BkWTOt2SOPArA0nQLa2rEKOB/xTXTdIhsqBL7j 9HOW/h9uzEwycLhh5oL0A10s0hqrfV1JBrebEMbPt84JhXlxM57VII1YGP68hvFG 11QH/Z3hPPekRXr3R1yiWC1Xtv8nY4jjOTEeP3pxOfxucB64b0+oyZwqo+hifY97 NQ0NQ0vQ9YbrcJgbvFEH/9hZNiglXTPOuFyv2OEqnoX8cqb1CBBhoKsH9aS8s3rQ 7TGADzlddkA4AbIcmPHsZisjcLahki5S+ARQjl8XaCKIwRWtCbGwMA8Po1RfvPqo wb/0FmviFAz1KNsCngHh =0jb4 -----END PGP SIGNATURE----- --=-=-=--