[svn] GnuPG - r4434 - in trunk: agent doc
svn author wk
cvs at cvs.gnupg.org
Wed Feb 14 17:27:56 CET 2007
Author: wk
Date: 2007-02-14 17:27:55 +0100 (Wed, 14 Feb 2007)
New Revision: 4434
Modified:
trunk/agent/ChangeLog
trunk/agent/agent.h
trunk/agent/call-pinentry.c
trunk/agent/gpg-agent.c
trunk/doc/ChangeLog
trunk/doc/gpg-agent.texi
trunk/doc/scdaemon.texi
Log:
agent/
* gpg-agent.c: New option --pinentry-touch-file.
(get_agent_socket_name): New.
* agent.h (opt): Add pinentry_touch_file.
* call-pinentry.c (start_pinentry): Send new option to the
pinentry.
Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/agent/ChangeLog 2007-02-14 16:27:55 UTC (rev 4434)
@@ -1,3 +1,11 @@
+2007-02-14 Werner Koch <wk at g10code.com>
+
+ * gpg-agent.c: New option --pinentry-touch-file.
+ (get_agent_socket_name): New.
+ * agent.h (opt): Add pinentry_touch_file.
+ * call-pinentry.c (start_pinentry): Send new option to the
+ pinentry.
+
2007-01-31 Moritz Schulte <moritz at g10code.com> (wk)
* command-ssh.c (stream_read_string): Initialize LENGTH to zero.
Modified: trunk/agent/agent.h
===================================================================
--- trunk/agent/agent.h 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/agent/agent.h 2007-02-14 16:27:55 UTC (rev 4434)
@@ -72,6 +72,10 @@
int disable_scdaemon; /* Never use the SCdaemon. */
int no_grab; /* Don't let the pinentry grab the keyboard */
+ /* The name of the file pinentry shall tocuh before exiting. If
+ this is not set the filoe name of the standard socket is used. */
+ const char *pinentry_touch_file;
+
/* The default and maximum TTL of cache entries. */
unsigned long def_cache_ttl; /* Default. */
unsigned long def_cache_ttl_ssh; /* for SSH. */
@@ -186,6 +190,7 @@
/*-- gpg-agent.c --*/
void agent_exit (int rc) JNLIB_GCC_A_NR; /* Also implemented in other tools */
+const char *get_agent_socket_name (void);
/*-- command.c --*/
gpg_error_t agent_write_status (ctrl_t ctrl, const char *keyword, ...);
Modified: trunk/agent/call-pinentry.c
===================================================================
--- trunk/agent/call-pinentry.c 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/agent/call-pinentry.c 2007-02-14 16:27:55 UTC (rev 4434)
@@ -181,6 +181,7 @@
int no_close_list[3];
int i;
pth_event_t evt;
+ const char *tmpstr;
evt = pth_event (PTH_EVENT_TIME, pth_timeout (LOCK_TIMEOUT, 0));
if (!pth_mutex_acquire (&entry_lock, 0, evt))
@@ -297,6 +298,30 @@
if (rc)
return unlock_pinentry (rc);
}
+
+
+ /* Tell the pinentry the name of a file it shall touch after having
+ messed with the tty. This is optional and only supported by
+ newer pinentries and thus we do no error checking. */
+ tmpstr = opt.pinentry_touch_file;
+ if (tmpstr && !strcmp (tmpstr, "/dev/null"))
+ tmpstr = NULL;
+ else if (!tmpstr)
+ tmpstr = get_agent_socket_name ();
+ if (tmpstr)
+ {
+ char *optstr;
+
+ if (asprintf (&optstr, "OPTION touch-file=%s", tmpstr ) < 0 )
+ ;
+ else
+ {
+ assuan_transact (entry_ctx, optstr, NULL, NULL, NULL, NULL, NULL,
+ NULL);
+ free (optstr);
+ }
+ }
+
return 0;
}
Modified: trunk/agent/gpg-agent.c
===================================================================
--- trunk/agent/gpg-agent.c 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/agent/gpg-agent.c 2007-02-14 16:27:55 UTC (rev 4434)
@@ -78,6 +78,7 @@
oBatch,
oPinentryProgram,
+ oPinentryTouchFile,
oDisplay,
oTTYname,
oTTYtype,
@@ -131,6 +132,7 @@
{ oPinentryProgram, "pinentry-program", 2 ,
N_("|PGM|use PGM as the PIN-Entry program") },
+ { oPinentryTouchFile, "pinentry-touch-file", 2 , "@" },
{ oScdaemonProgram, "scdaemon-program", 2 ,
N_("|PGM|use PGM as the SCdaemon program") },
{ oDisableScdaemon, "disable-scdaemon", 0, N_("do not use the SCdaemon") },
@@ -401,6 +403,7 @@
opt.debug = 0;
opt.no_grab = 0;
opt.pinentry_program = NULL;
+ opt.pinentry_touch_file = NULL;
opt.scdaemon_program = NULL;
opt.def_cache_ttl = DEFAULT_CACHE_TTL;
opt.def_cache_ttl_ssh = DEFAULT_CACHE_TTL_SSH;
@@ -437,6 +440,7 @@
case oNoGrab: opt.no_grab = 1; break;
case oPinentryProgram: opt.pinentry_program = pargs->r.ret_str; break;
+ case oPinentryTouchFile: opt.pinentry_touch_file = pargs->r.ret_str; break;
case oScdaemonProgram: opt.scdaemon_program = pargs->r.ret_str; break;
case oDisableScdaemon: opt.disable_scdaemon = 1; break;
@@ -1186,8 +1190,18 @@
}
+/* Return the file name of the socket we are using for native
+ requests. */
+const char *
+get_agent_socket_name (void)
+{
+ const char *s = socket_name;
+ return (s && *s)? s : NULL;
+}
+
+
/* Create a name for the socket. With USE_STANDARD_SOCKET given as
true using STANDARD_NAME in the home directory or if given has
false from the mkdir type name TEMPLATE. In the latter case a
Modified: trunk/doc/ChangeLog
===================================================================
--- trunk/doc/ChangeLog 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/doc/ChangeLog 2007-02-14 16:27:55 UTC (rev 4434)
@@ -1,3 +1,7 @@
+2007-02-14 Werner Koch <wk at g10code.com>
+
+ * gpg-agent.texi (Agent Options): Doc --pinentry-touch-file.
+
2007-02-05 Werner Koch <wk at g10code.com>
* debugging.texi (Common Problems): Tell how to export a private
Modified: trunk/doc/gpg-agent.texi
===================================================================
--- trunk/doc/gpg-agent.texi 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/doc/gpg-agent.texi 2007-02-14 16:27:55 UTC (rev 4434)
@@ -344,6 +344,17 @@
Use program @var{filename} as the PIN entry. The default is installation
dependend and can be shown with the @code{--version} command.
+ at item --pinentry-touch-file @var{filename}
+ at opindex pinentry-touch-file
+By default the file name of the socket gpg-agent is listening for
+requests is passed to Pinentry, so that it can touch that file before
+exiting (it does this only in curses mode). This option changes the
+file passed to Pinentry to @var{filename}. The special name
+ at code{/dev/null} may be used to completely disable this feature. Note
+that Pinentry will not create that file, it will only change the
+modification and access time.
+
+
@item --scdaemon-program @var{filename}
@opindex scdaemon-program
Use program @var{filename} as the Smartcard daemon. The default is
Modified: trunk/doc/scdaemon.texi
===================================================================
--- trunk/doc/scdaemon.texi 2007-02-14 16:26:05 UTC (rev 4433)
+++ trunk/doc/scdaemon.texi 2007-02-14 16:27:55 UTC (rev 4434)
@@ -311,7 +311,7 @@
@subsection The DINSIG card application ``dinsig''
This is an application as described in the German draft standard
- at emph{DIN V 66291-1}. It is intended to be used by cards supporteing
+ at emph{DIN V 66291-1}. It is intended to be used by cards supporting
the German signature law and its bylaws (SigG and SigV).
@node PKCS#15 Card
More information about the Gnupg-commits
mailing list