From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sascha Wilde Newsgroups: gmane.emacs.devel Subject: Re: Fix needed for communication with gpg-agent Date: Thu, 22 Feb 2007 23:00:49 +0100 Message-ID: References: <87irdzs6pp.fsf@stupidchicken.com> <87fy91g1pl.fsf@catnip.gol.com> <87wt2dk2rv.fsf@stupidchicken.com> <873b4yt7xx.fsf@stupidchicken.com> <87ps82ukz8.fsf@wheatstone.g10code.de> <87slcynii0.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1172181685 31704 80.91.229.12 (22 Feb 2007 22:01:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 22 Feb 2007 22:01:25 +0000 (UTC) Cc: Werner Koch , Miles Bader , rms@gnu.org, Daiki Ueno , emacs-devel@gnu.org To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 22 23:01:16 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HKLzv-0006DM-Jt for ged-emacs-devel@m.gmane.org; Thu, 22 Feb 2007 23:01:07 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HKLzv-0004L1-9r for ged-emacs-devel@m.gmane.org; Thu, 22 Feb 2007 17:01:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HKLzk-0004Kw-CA for emacs-devel@gnu.org; Thu, 22 Feb 2007 17:00:56 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HKLzh-0004Kk-UT for emacs-devel@gnu.org; Thu, 22 Feb 2007 17:00:55 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HKLzh-0004Kh-Ol for emacs-devel@gnu.org; Thu, 22 Feb 2007 17:00:53 -0500 Original-Received: from ns.km1136.keymachine.de ([62.141.58.119] helo=km1136.keymachine.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1HKLzf-0001YX-EG; Thu, 22 Feb 2007 17:00:51 -0500 Original-Received: from kenny.sha-bang.de (xdsla009.osnanet.de [212.95.101.9]) (authenticated bits=0) by km1136.keymachine.de (8.12.11.20060308/8.12.10) with ESMTP id l1MM0fGb018109; Thu, 22 Feb 2007 23:00:42 +0100 Original-Received: from wilde by kenny.sha-bang.de with local (Kenny MUA v.0409034.42) ID 1HKLzd-0003QW-UV; Thu, 22 Feb 2007 23:00:49 +0100 In-Reply-To: <87slcynii0.fsf@stupidchicken.com> (Chong Yidong's message of "Thu\, 22 Feb 2007 13\:40\:23 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.93 (gnu/linux) X-detected-kernel: Linux 2.4-2.6 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:66648 Archived-At: Chong Yidong wrote: > Werner Koch writes: > >>> Admittedly, it is a rather naughty solution: GPG is called through an >>> elisp terminal (as implemented by `make-term' in term.el), with a >>> modified process filter whose purpose is to send GPG the string to be >> >> With all that code running in emacs, I doubt that it makes sense at >> all to use the curses versions of Pinentry. > > In that case, I think Emacs should disable use of gpg-agent when > running in a console, except when gpg-agent already has a passphrase > cached. Then all we need is some method for Emacs to determine if the > necessary passphrase is cached. Even if it is possible to determine this (I don't know right now), there is an additional problem: the key caching of the gpg-agent times out after an configurable interval, so after that time emacs would suddenly stop using the agent -- this sounds like undesirable to me... > If gpg-agent does not have the > passphrase, Emacs will then prompting for the passphrase and send it > to GPG, without caching it in Elisp (i.e. subsequent calls to GPG will > require entering the passphrase again). I think this suggestion is based on a misunderstanding -- the security problems in the current implementation (when not using gpg-agent) has nothing to do with caching, it comes form the fact, that emacs writes the the passphrase to an temporary file (which is then feed to gpg). >> Is it possible to enhance server-start/emacsclient so that it does not >> edit a file but asks for string and returns that one? Pinentry could >> then use this feature for user interaction. > > I'm not sure how this suggestion could work. I haven't fully understood this idea, too. In general I doubt, that it is an good idea to make gpg-agent depend on an running emacs for passphrase input -- even if many emacs users are using emacs as there primary working environment and therefor have it running all the time -- not everyone does... cheers sascha -- Sascha Wilde Life's too short to read boring signatures