[svn] GnuPG - r5398 - in trunk: doc tools

svn author wk cvs at cvs.gnupg.org
Thu Aug 19 11:53:56 CEST 2010


Author: wk
Date: 2010-08-19 11:53:55 +0200 (Thu, 19 Aug 2010)
New Revision: 5398

Modified:
   trunk/doc/gpg-agent.texi
   trunk/tools/ChangeLog
   trunk/tools/gpgconf-comp.c
Log:
Add component pinentry as an easy way to figure out the default
pinentry.  Also allows to test whether pinentry is installed.


Modified: trunk/tools/ChangeLog
===================================================================
--- trunk/tools/ChangeLog	2010-08-18 19:25:15 UTC (rev 5397)
+++ trunk/tools/ChangeLog	2010-08-19 09:53:55 UTC (rev 5398)
@@ -1,3 +1,10 @@
+2010-08-19  Werner Koch  <wk at g10code.com>
+
+	* gpgconf-comp.c: Add new backend and component for PINENTRY.
+	(gc_component_check_options): Use --version to test the pinentry.
+	(gc_component_retrieve_options, gc_component_change_options):
+	Ignore the pinentry component.
+
 2010-08-16  Werner Koch  <wk at g10code.com>
 
 	* gpgconf.c (get_outfp): Change to use estream.

Modified: trunk/doc/gpg-agent.texi
===================================================================
--- trunk/doc/gpg-agent.texi	2010-08-18 19:25:15 UTC (rev 5397)
+++ trunk/doc/gpg-agent.texi	2010-08-19 09:53:55 UTC (rev 5398)
@@ -399,7 +399,7 @@
 @item --pinentry-program @var{filename}
 @opindex pinentry-program
 Use program @var{filename} as the PIN entry.  The default is installation
-dependent and can be shown with the @code{--version} command.
+dependent.
 
 @item --pinentry-touch-file @var{filename}
 @opindex pinentry-touch-file
@@ -415,7 +415,7 @@
 @item --scdaemon-program @var{filename}
 @opindex scdaemon-program
 Use program @var{filename} as the Smartcard daemon.  The default is
-installation dependent and can be shown with the @code{--version}
+installation dependent and can be shown with the @command{gpgconf}
 command.
 
 @item --disable-scdaemon

Modified: trunk/tools/gpgconf-comp.c
===================================================================
--- trunk/tools/gpgconf-comp.c	2010-08-18 19:25:15 UTC (rev 5397)
+++ trunk/tools/gpgconf-comp.c	2010-08-19 09:53:55 UTC (rev 5398)
@@ -133,12 +133,15 @@
     /* The GnuPG SCDaemon.  */
     GC_BACKEND_SCDAEMON,
 
-    /* The Aegypten directory manager.  */
+    /* The GnuPG directory manager.  */
     GC_BACKEND_DIRMNGR,
 
-    /* The LDAP server list file for the Aegypten director manager.  */
+    /* The LDAP server list file for the director manager.  */
     GC_BACKEND_DIRMNGR_LDAP_SERVER_LIST,
 
+    /* The Pinentry (not a part of GnuPG, proper).  */
+    GC_BACKEND_PINENTRY,
+
     /* The number of the above entries.  */
     GC_BACKEND_NR
   } gc_backend_t;
@@ -158,7 +161,7 @@
 
   /* The module name (GNUPG_MODULE_NAME_foo) as defined by
      ../common/util.h.  This value is used to get the actual installed
-     path of the program.  0 is used if no backedn program is
+     path of the program.  0 is used if no backend program is
      available. */
   char module_name;
 
@@ -189,6 +192,8 @@
       NULL, "gpgconf-dirmngr.conf" },
     { "DirMngr LDAP Server List", NULL, 0, 
       NULL, "ldapserverlist-file", "LDAP Server" },
+    { "Pinentry", "pinentry", GNUPG_MODULE_NAME_PINENTRY,
+      NULL, "gpgconf-pinentry.conf" },
   };
 
 
@@ -939,6 +944,19 @@
    GC_OPTION_NULL
  };
 
+
+/* The options of the GC_COMPONENT_PINENTRY component.  */
+static gc_option_t gc_options_pinentry[] =
+ {
+   /* A dummy option to allow gc_component_list_components to find the
+      pinentry backend.  Needs to be a conf file. */
+   { "gpgconf-pinentry.conf", GC_OPT_FLAG_NONE, GC_LEVEL_INTERNAL,
+     NULL, NULL, GC_ARG_TYPE_FILENAME, GC_BACKEND_PINENTRY },
+
+   GC_OPTION_NULL
+ };
+
+
 
 /* Component system.  Each component is a set of options that can be
    configured at the same time.  If you change this, don't forget to
@@ -960,6 +978,9 @@
     /* The LDAP Directory Manager for CRLs.  */
     GC_COMPONENT_DIRMNGR,
 
+    /* The external Pinentry.  */
+    GC_COMPONENT_PINENTRY,
+
     /* The number of components.  */
     GC_COMPONENT_NR
   } gc_component_t;
@@ -988,7 +1009,8 @@
     { "gpg-agent", NULL, "GPG Agent", gc_options_gpg_agent },
     { "scdaemon", NULL, "Smartcard Daemon", gc_options_scdaemon },
     { "gpgsm", NULL, "GPG for S/MIME", gc_options_gpgsm },
-    { "dirmngr", NULL, "Directory Manager", gc_options_dirmngr }
+    { "dirmngr", NULL, "Directory Manager", gc_options_dirmngr },
+    { "pinentry", NULL, "PIN and Passphrase Entry", gc_options_pinentry }
   };
 
 
@@ -1482,7 +1504,10 @@
       argv[i++] = "--options";
       argv[i++] = conf_file;
     }
-  argv[i++] = "--gpgconf-test";
+  if (component == GC_COMPONENT_PINENTRY)
+    argv[i++] = "--version";
+  else
+    argv[i++] = "--gpgconf-test";
   argv[i++] = NULL;
   
   err = gnupg_create_inbound_pipe (filedes);
@@ -1556,6 +1581,7 @@
 }
 
 
+
 /* Check all components that are available.  */
 void
 gc_check_programs (estream_t out)
@@ -2117,6 +2143,9 @@
   gc_backend_t backend;
   gc_option_t *option;
 
+  if (component == GC_COMPONENT_PINENTRY)
+    return; /* Dummy module for now.  */
+
   for (backend = 0; backend < GC_BACKEND_NR; backend++)
     backend_seen[backend] = 0;
 
@@ -2992,6 +3021,9 @@
   size_t line_len = 0;
   ssize_t length;
 
+  if (component == GC_COMPONENT_PINENTRY)
+    return; /* Dummy component for now.  */
+
   for (backend = 0; backend < GC_BACKEND_NR; backend++)
     {
       runtime[backend] = 0;





More information about the Gnupg-commits mailing list