unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Fix needed for communication with gpg-agent
@ 2007-02-17 20:57 Richard Stallman
  2007-02-18 17:42 ` Chong Yidong
  0 siblings, 1 reply; 63+ messages in thread
From: Richard Stallman @ 2007-02-17 20:57 UTC (permalink / raw)
  To: emacs-devel

Would someone please implement this code, needed for correct
redisplay after running pinentry?  Then please ack.

------- Start of forwarded message -------
From: Werner Koch <wk@gnupg.org>
To: rms@gnu.org
Subject: Redraw after calling gpg (was: [bug] PGG shows ?? when prompt for passphrase)
CC: ueno@unixuser.org
Organisation: g10 Code GmbH
Date: Wed, 14 Feb 2007 19:02:56 +0100
In-Reply-To: <E1HFfUN-0001ps-TY@fencepost.gnu.org> (Richard Stallman's message
	of "Fri\, 09 Feb 2007 18\:49\:11 -0500")
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=failed 
	version=3.0.4

On Sat, 10 Feb 2007 00:49, rms@gnu.org said:

> Can you write a self-contained proposal?  I will forward it to the
> other Emacs developers to ask someone to implement it or suggest
> changes.

gpg-agent is a tool to take care of passphrase caching, private key
operations and smart card access.  It works as a dameon started for
eahc user and calls a tool called Pinentry if it requires input from
the user (Passphrase or PIN).  This works very well on X11 as Pinentry
can create its own windows soley under its own control.

Without X, Pinentry falls back to a curses implementation (there is
also a curses only version of Pinentry).  This works pretty reliable
but poses one problem: The screen needs a redraw as there is no
portable way to save and restore the old screen content.  What can be
done is to redraw the screen every time after calling a crypto
operation which uses gpg or gpgsm.  This is of course not optimal as
in most cases the passphrase has been cached and an expensive redraw
is not required.

To solve this problem the latest SVN Pinentry (-r 155) and GnuPG (-r
4434) have a new feature: Pinentry will touch a file if the curses
version has been used right before returning control to gpg-agent and
eventually to the calling appliaction.  The file we touch is by
default the socket gpg-agent is listening fro requests by gpg or
gpgsm.

An application calling gpg and expecting thyat a pinentry might pop up
(i.e. signing or decrypting) should record the mtime of the socket
file and compare that after the call to gpg.  If it changed a redraw
should be done.  What a applaiction needs to do:

  1. Get the value of the envvar GPG_AGENT_INFO.  This envvar is set by
     gpg-agent and the central information on how to access gpg-agent.
     It works similar to the way ssh-agent works.  Example:
  
       $ echo $GPG_AGENT_INFO
       /tmp/gpg-0Hg6cf/S.gpg-agent:22391:1
  
  2. Parse that value and pass the first part to file-attributes.
     Record the mtime.
  
  3. Call gpg or gpgsm
  
  4. Do a file-attributes again on that file and compare the mtime
     against the recorded one.
  
  5. It there is a mismatch a redraw should be done.
  

Cronjobs invoking gpg (or ssh when --enable-ssh-support is used with
gpg-agent) might also lead to a pinentry pop up.  We can't do much
about this but I don't think that it is a real problem.  Such a
Pinentry will only pop up rarely and hitting C-l is much easier than
any other method.

if you want to test this system and are using X, you can add a line
like

  pinentry-program /usr/local/bin/pinentry-curses

into ~/.gnupg/gpg-agent.conf and give gpg-agent a HUP.


Salam-Shalom,

   Werner
------- End of forwarded message -------

^ permalink raw reply	[flat|nested] 63+ messages in thread

end of thread, other threads:[~2007-02-28  2:37 UTC | newest]

Thread overview: 63+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-17 20:57 Fix needed for communication with gpg-agent Richard Stallman
2007-02-18 17:42 ` Chong Yidong
2007-02-19 23:35   ` Miles Bader
2007-02-20  1:59     ` Chong Yidong
2007-02-22 17:31       ` Chong Yidong
2007-02-22 17:44         ` Chong Yidong
2007-02-22 18:04         ` Werner Koch
2007-02-22 18:40           ` Chong Yidong
2007-02-22 22:00             ` Sascha Wilde
2007-02-22 22:47               ` Chong Yidong
2007-02-23 20:01                 ` Sascha Wilde
2007-02-24  8:28                   ` Richard Stallman
2007-02-23 22:09               ` Richard Stallman
2007-02-23 23:41                 ` Sascha Wilde
2007-02-25  4:06                   ` Richard Stallman
2007-02-25 19:32                     ` Chong Yidong
2007-02-25 19:50                       ` Andreas Schwab
2007-02-25 20:22                         ` David Kastrup
2007-02-26  3:27                       ` Richard Stallman
2007-02-26 10:27                         ` Werner Koch
2007-02-27  7:38                           ` Richard Stallman
2007-02-27  8:53                             ` Werner Koch
2007-02-28  2:37                               ` Richard Stallman
2007-02-23  8:53             ` Werner Koch
2007-02-23 10:27               ` Sascha Wilde
2007-02-23 16:23               ` Chong Yidong
2007-02-23 16:47                 ` Werner Koch
2007-02-23 19:37                   ` Chong Yidong
2007-02-23 20:10                     ` Sascha Wilde
2007-02-23 22:10                     ` Richard Stallman
2007-02-23 22:09                   ` Richard Stallman
2007-02-23 23:03                     ` Chong Yidong
2007-02-23 17:13           ` Andreas Schwab
2007-02-23 18:30             ` Kim F. Storm
2007-02-23 18:07           ` Stefan Monnier
2007-02-24 14:08             ` Miles Bader
2007-02-23 19:35         ` Richard Stallman
2007-02-20 13:43     ` Richard Stallman
2007-02-20 15:35       ` Chong Yidong
2007-02-21  8:37         ` Richard Stallman
2007-02-21 12:04           ` Chong Yidong
2007-02-22 17:21             ` Richard Stallman
2007-02-20 15:11   ` Kim F. Storm
2007-02-20 15:45     ` Chong Yidong
2007-02-21  8:37     ` Richard Stallman
2007-02-21 13:11       ` Chong Yidong
2007-02-22  7:19         ` Richard Stallman
     [not found]   ` <E1HJCsN-000541-DO@fencepost.gnu.org>
2007-02-21 22:41     ` Sascha Wilde
2007-02-21 23:15       ` Kim F. Storm
2007-02-22  0:14         ` Chong Yidong
2007-02-22  8:04           ` Werner Koch
2007-02-22 12:09           ` Kim F. Storm
2007-02-22  8:13         ` Werner Koch
2007-02-23 10:22           ` Richard Stallman
2007-02-23 13:20             ` Werner Koch
2007-02-23 16:40               ` Chong Yidong
2007-02-23 22:09               ` Richard Stallman
2007-02-23 19:36           ` Richard Stallman
2007-02-23 23:25             ` Chong Yidong
2007-02-23 23:58               ` Kim F. Storm
2007-02-24  0:19                 ` Chong Yidong
2007-02-24  0:57                   ` Kim F. Storm
2007-02-24  9:58                     ` Sascha Wilde

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).