From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.devel,gmane.emacs.gnus.general Subject: Re: Small patch to enable use of gpg-agent with pgg Date: Sun, 26 Mar 2006 03:08:04 +0200 Message-ID: <87wteiypvv.fsf@latte.josefsson.org> References: <2cd46e7f0510031250u66ea1349yb437d539ce4027ef@mail.gmail.com> <20051008103627.GA1218@kenny.sha-bang.local> <2cd46e7f0510081131h14e2bbeaga7f1a33ebd6347c8@mail.gmail.com> <2cd46e7f0510101415t76825ea7u9749fe23da54ce@mail.gmail.com> <2cd46e7f0510121647x3c51fb65pc883ed61f4e864ab@mail.gmail.com> <2cd46e7f0510200708x4640d1c2t50743cf439e52dd4@mail.gmail.com> <87pskfq361.fsf@latte.josefsson.org> <877j6mg2af.fsf@latte.josefsson.org> <87lkv1whmh.fsf@latte.josefsson.org> <897751e5-a148-4109-8da6-6f69cce0dec0@well-done.deisui.org> <87d5gd2ts1.fsf@latte.josefsson.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1143335324 22383 80.91.229.2 (26 Mar 2006 01:08:44 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 26 Mar 2006 01:08:44 +0000 (UTC) Cc: Sascha Wilde , ding@gnus.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 26 03:08:41 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FNJkF-0001rq-Aw for ged-emacs-devel@m.gmane.org; Sun, 26 Mar 2006 03:08:40 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNJkC-0008VQ-Ol for ged-emacs-devel@m.gmane.org; Sat, 25 Mar 2006 20:08:36 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FNJjq-0008Tj-Pl for emacs-devel@gnu.org; Sat, 25 Mar 2006 20:08:15 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FNJjo-0008Rr-46 for emacs-devel@gnu.org; Sat, 25 Mar 2006 20:08:13 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FNJjn-0008Rk-Ne for emacs-devel@gnu.org; Sat, 25 Mar 2006 20:08:11 -0500 Original-Received: from [217.13.230.178] (helo=yxa.extundo.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1FNJkx-0007Pj-Cn for emacs-devel@gnu.org; Sat, 25 Mar 2006 20:09:23 -0500 Original-Received: from localhost.localdomain (yxa.extundo.com [217.13.230.178]) (authenticated bits=0) by yxa.extundo.com (8.13.4/8.13.4/Debian-3sarge1) with ESMTP id k2Q184C3011236; Sun, 26 Mar 2006 03:08:04 +0200 Original-To: Daiki Ueno OpenPGP: id=B565716F; url=http://josefsson.org/key.txt X-Hashcash: 1:21:060326:wilde@sha-bang.de::bkq/idWyGgA/19rN:7It X-Hashcash: 1:21:060326:emacs-devel@gnu.org::VExngs6E/o8frCO3:36sM X-Hashcash: 1:21:060326:ueno@unixuser.org::FeaoEaMKKnlZCtHc:D8hr X-Hashcash: 1:21:060326:ding@gnus.org::bvrmNWpY8og0sFBE:HYde In-Reply-To: (Daiki Ueno's message of "Sun, 26 Mar 2006 09:29:32 +0900") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Virus-Scanned: ClamAV version 0.88, clamav-milter version 0.87 on yxa.extundo.com X-Virus-Status: Clean X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:52063 gmane.emacs.gnus.general:62404 Archived-At: Daiki Ueno writes: >>>>>> In >>>>>> Daiki Ueno wrote: >> > Maybe you can finish this code, and I can debug why it doesn't work >> > for a smartcard separately. It is probably not an important feature. > >> The new code mostly finished. > > Ok, the attached file is (hopefully) the final version of the new code. > Differences from the previous one are: > > - Passphrase caching now works again. > - pgg-gpg-use-agent is abolished. Add "use-agent" to ~/.gnupg/gpg.conf > if you want to enable use of gpg-agent, as Miles said. > - Tested with typical cases. I also attach some test cases I used. This works fine except for used with a smartcard. The current version works with a smartcard (when you enable pgg-gpg-use-agent), so I think that should be fixed. I debugged this, and it seems invoking gpg using the smartcard will not print any useful [GNUPG:] statements: /usr/bin/gpg --no-tty --status-fd 1 --command-fd 0 --yes --output /tmp/pgg-output29825FPB --detach-sign --armor --verbose --local-user jas --textmode ... gpg: using subkey AABB1F7B instead of primary key B565716F gpg: writing to `/tmp/pgg-output29825FPB' Then it waits for input. PGG infloop waiting for GOOD_PASSPHRASE here. I think it should wait for 'gpg: writing to' instead, it is the last printed statement for both smartcard and non-smartcard cases, and it seem to be printed when gpg is ready to accept input. For references, here is the non-smartcard case: jas@latte:~$ /usr/bin/gpg --no-tty --status-fd 1 --command-fd 0 --yes --output /tmp/pgg-output29825FPB --detach-sign --armor --verbose --local-user b565716f! --textmode [GNUPG:] USERID_HINT EDA21E94B565716F Simon Josefsson [GNUPG:] NEED_PASSPHRASE EDA21E94B565716F EDA21E94B565716F 1 0 <<>> [GNUPG:] GOOD_PASSPHRASE gpg: writing to `/tmp/pgg-output29825FPB' Then it hangs waiting for the input to sign. What do you think? It might be ugly to depend on the 'gpg: writing' output instead of the [GNUPG:] stuff, but I see no option here. I suspect password-less keys may have similar issues.