[git] GnuPG - branch, master, updated. post-nuke-of-trailing-ws-23-gb7f74f5

by Werner Koch cvs at cvs.gnupg.org
Wed Mar 2 10:18:45 CET 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  b7f74f5b46a28d200627ab9b67763891190a8e15 (commit)
       via  cb803a4b2789d1300e201236c86945daf58c667f (commit)
       via  fa58a834ff994267307a344151bdc344590ecb47 (commit)
       via  528d77a0ccad4e54480ea4f069b4bbc28779b3ce (commit)
       via  0706511b6d10561e97381554e404a960538ee342 (commit)
       via  2165925baeaa42f611b75718f3b2e9b37c53e417 (commit)
      from  00f8b68505ae3195a862a5235063f6f0d71edc27 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b7f74f5b46a28d200627ab9b67763891190a8e15
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Mar 2 09:50:12 2011 +0100

    Add comment to last patch.

diff --git a/agent/ChangeLog b/agent/ChangeLog
index f8156bc..783089e 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,6 +1,8 @@
 2011-03-02  Ben Kibbey  <bjk at luxsci.net>  (wk)
 
 	* command.c (cmd_clear_passphrase): Add option --mode=normal.
+	(cmd_keyinfo): Add option --data.
+        (do_one_keyinfo): Return CACHED status.  Add arg DATA.
 
 2011-02-07  Werner Koch  <wk at g10code.com>
 
@@ -2928,7 +2930,7 @@ Fri Aug 18 14:27:14 CEST 2000  Werner Koch  <wk at openit.de>
 
 
  Copyright 2001, 2002, 2003, 2004, 2005,
-	   2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+	   2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 
  This file is free software; as a special exception the author gives
  unlimited permission to copy and/or distribute it, with or without
diff --git a/agent/command.c b/agent/command.c
index b6f5cfb..79b9b97 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -954,13 +954,13 @@ static const char hlp_keyinfo[] =
   "IDSTR is the IDSTR used to distinguish keys on a smartcard.  If it\n"
   "      is not known a dash is used instead.\n"
   "\n"
-  "CACHED is 1 if the key was found in the key cache. If not, a '-'\n"
-  "is used instead.\n"
+  "CACHED is 1 if the passphrase for the key was found in the key cache.\n"
+  "       If not, a '-' is used instead.\n"
   "\n"
   "More information may be added in the future.";
 static gpg_error_t
 do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip, assuan_context_t ctx,
-    int data)
+                int data)
 {
   gpg_error_t err;
   char hexgrip[40+1];
@@ -969,7 +969,7 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip, assuan_context_t ctx,
   char *serialno = NULL;
   char *idstr = NULL;
   const char *keytypestr;
-  char *cached;
+  const char *cached;
   char *pw;
 
   err = agent_key_info_from_file (ctrl, grip, &keytype, &shadow_info);
@@ -987,6 +987,9 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip, assuan_context_t ctx,
   else
     keytypestr = "-";
 
+  /* Here we have a little race by doing the cache check separately
+     from the retrieval function.  Given that the cache flag is only a
+     hint, it should not really matter.  */
   pw = agent_get_cache (hexgrip, CACHE_MODE_NORMAL);
   cached = pw ? "1" : "-";
   xfree (pw);
@@ -1006,16 +1009,20 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip, assuan_context_t ctx,
                               idstr? idstr : "-",
                               cached,
                               NULL);
-  else {
-    char *string = xtryasprintf ("%s %s %s %s %s\n", hexgrip, keytypestr,
-	serialno? serialno : "-", idstr? idstr : "-", cached);
-
-    if (!string)
-      err = gpg_error_from_syserror ();
+  else
+    {
+      char *string;
 
-    err = assuan_send_data(ctx, string, strlen(string));
-    xfree(string);
-  }
+      string = xtryasprintf ("%s %s %s %s %s\n",
+                             hexgrip, keytypestr,
+                             serialno? serialno : "-",
+                             idstr? idstr : "-", cached);
+      if (!string)
+        err = gpg_error_from_syserror ();
+      else
+        err = assuan_send_data (ctx, string, strlen(string));
+      xfree (string);
+    }
 
  leave:
   xfree (shadow_info);

commit cb803a4b2789d1300e201236c86945daf58c667f
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Tue Mar 1 21:18:45 2011 -0500

    Added option --data to KEYINFO to return the result with a data response.

diff --git a/agent/command.c b/agent/command.c
index ddcb067..b6f5cfb 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -930,13 +930,13 @@ cmd_readkey (assuan_context_t ctx, char *line)
 
 
 static const char hlp_keyinfo[] =
-  "KEYINFO [--list] <keygrip>\n"
+  "KEYINFO [--list] [--data] <keygrip>\n"
   "\n"
   "Return information about the key specified by the KEYGRIP.  If the\n"
   "key is not available GPG_ERR_NOT_FOUND is returned.  If the option\n"
   "--list is given the keygrip is ignored and information about all\n"
   "available keys are returned.  The information is returned as a\n"
-  "status line with this format:\n"
+  "status line unless --data was specified, with this format:\n"
   "\n"
   "  KEYINFO <keygrip> <type> <serialno> <idstr> <cached>\n"
   "\n"
@@ -959,7 +959,8 @@ static const char hlp_keyinfo[] =
   "\n"
   "More information may be added in the future.";
 static gpg_error_t
-do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
+do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip, assuan_context_t ctx,
+    int data)
 {
   gpg_error_t err;
   char hexgrip[40+1];
@@ -997,13 +998,25 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
         goto leave;
     }
 
-  err = agent_write_status (ctrl, "KEYINFO",
-                            hexgrip,
-                            keytypestr,
-                            serialno? serialno : "-",
-                            idstr? idstr : "-",
-                            cached,
-                            NULL);
+  if (!data)
+    err = agent_write_status (ctrl, "KEYINFO",
+                              hexgrip,
+                              keytypestr,
+                              serialno? serialno : "-",
+                              idstr? idstr : "-",
+                              cached,
+                              NULL);
+  else {
+    char *string = xtryasprintf ("%s %s %s %s %s\n", hexgrip, keytypestr,
+	serialno? serialno : "-", idstr? idstr : "-", cached);
+
+    if (!string)
+      err = gpg_error_from_syserror ();
+
+    err = assuan_send_data(ctx, string, strlen(string));
+    xfree(string);
+  }
+
  leave:
   xfree (shadow_info);
   xfree (serialno);
@@ -1020,8 +1033,10 @@ cmd_keyinfo (assuan_context_t ctx, char *line)
   unsigned char grip[20];
   DIR *dir = NULL;
   int list_mode;
+  int opt_data;
 
   list_mode = has_option (line, "--list");
+  opt_data = has_option (line, "--data");
   line = skip_options (line);
 
   if (list_mode)
@@ -1056,7 +1071,7 @@ cmd_keyinfo (assuan_context_t ctx, char *line)
           if ( hex2bin (hexgrip, grip, 20) < 0 )
             continue; /* Bad hex string.  */
 
-          err = do_one_keyinfo (ctrl, grip);
+          err = do_one_keyinfo (ctrl, grip, ctx, opt_data);
           if (err)
             goto leave;
         }
@@ -1067,7 +1082,7 @@ cmd_keyinfo (assuan_context_t ctx, char *line)
       err = parse_keygrip (ctx, line, grip);
       if (err)
         goto leave;
-      err = do_one_keyinfo (ctrl, grip);
+      err = do_one_keyinfo (ctrl, grip, ctx, opt_data);
     }
 
  leave:

commit fa58a834ff994267307a344151bdc344590ecb47
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Tue Mar 1 20:29:08 2011 -0500

    Let KEYINFO show the cached status of a key grip.

diff --git a/agent/command.c b/agent/command.c
index 9533db7..ddcb067 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -938,7 +938,7 @@ static const char hlp_keyinfo[] =
   "available keys are returned.  The information is returned as a\n"
   "status line with this format:\n"
   "\n"
-  "  KEYINFO <keygrip> <type> <serialno> <idstr>\n"
+  "  KEYINFO <keygrip> <type> <serialno> <idstr> <cached>\n"
   "\n"
   "KEYGRIP is the keygrip.\n"
   "\n"
@@ -954,6 +954,9 @@ static const char hlp_keyinfo[] =
   "IDSTR is the IDSTR used to distinguish keys on a smartcard.  If it\n"
   "      is not known a dash is used instead.\n"
   "\n"
+  "CACHED is 1 if the key was found in the key cache. If not, a '-'\n"
+  "is used instead.\n"
+  "\n"
   "More information may be added in the future.";
 static gpg_error_t
 do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
@@ -965,6 +968,8 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
   char *serialno = NULL;
   char *idstr = NULL;
   const char *keytypestr;
+  char *cached;
+  char *pw;
 
   err = agent_key_info_from_file (ctrl, grip, &keytype, &shadow_info);
   if (err)
@@ -981,6 +986,10 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
   else
     keytypestr = "-";
 
+  pw = agent_get_cache (hexgrip, CACHE_MODE_NORMAL);
+  cached = pw ? "1" : "-";
+  xfree (pw);
+
   if (shadow_info)
     {
       err = parse_shadow_info (shadow_info, &serialno, &idstr);
@@ -993,6 +1002,7 @@ do_one_keyinfo (ctrl_t ctrl, const unsigned char *grip)
                             keytypestr,
                             serialno? serialno : "-",
                             idstr? idstr : "-",
+                            cached,
                             NULL);
  leave:
   xfree (shadow_info);

commit 528d77a0ccad4e54480ea4f069b4bbc28779b3ce
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Mar 2 09:11:40 2011 +0100

    Rename Ben's new option.

diff --git a/agent/ChangeLog b/agent/ChangeLog
index 0390275..f8156bc 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-02  Ben Kibbey  <bjk at luxsci.net>  (wk)
+
+	* command.c (cmd_clear_passphrase): Add option --mode=normal.
+
 2011-02-07  Werner Koch  <wk at g10code.com>
 
 	* pksign.c (do_encode_dsa): Enforce multipe of 8 bits only for DSA.
diff --git a/agent/command.c b/agent/command.c
index 63f59d4..9533db7 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1267,20 +1267,20 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
 
 
 static const char hlp_clear_passphrase[] =
-  "CLEAR_PASSPHRASE [--agent] <cache_id>\n"
+  "CLEAR_PASSPHRASE [--mode=normal] <cache_id>\n"
   "\n"
   "may be used to invalidate the cache entry for a passphrase.  The\n"
   "function returns with OK even when there is no cached passphrase.\n"
-  "The --agent option is used to clear an entry for a cacheid added by\n"
-  "the agent.\n";
+  "The --mode=normal option is used to clear an entry for a cacheid\n"
+  "added by the agent.\n";
 static gpg_error_t
 cmd_clear_passphrase (assuan_context_t ctx, char *line)
 {
   char *cacheid = NULL;
   char *p;
-  int opt_agent;
+  int opt_normal;
 
-  opt_agent = has_option (line, "--agent");
+  opt_normal = has_option (line, "--mode=normal");
   line = skip_options (line);
 
   /* parse the stuff */
@@ -1293,8 +1293,8 @@ cmd_clear_passphrase (assuan_context_t ctx, char *line)
   if (!cacheid || !*cacheid || strlen (cacheid) > 50)
     return set_error (GPG_ERR_ASS_PARAMETER, "invalid length of cacheID");
 
-  agent_put_cache (cacheid, opt_agent ? CACHE_MODE_NORMAL : CACHE_MODE_USER,
-	  NULL, 0);
+  agent_put_cache (cacheid, opt_normal ? CACHE_MODE_NORMAL : CACHE_MODE_USER,
+                   NULL, 0);
   return 0;
 }
 

commit 0706511b6d10561e97381554e404a960538ee342
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Sun Feb 27 08:35:16 2011 -0500

    Added CLEAR_PASSPHRASE option --agent to search the cache for a cacheid with a mode of CACHE_MODE_NORMAL. These cache modes are created with PKDECRYPT.

diff --git a/agent/command.c b/agent/command.c
index 330c851..63f59d4 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1267,15 +1267,21 @@ cmd_get_passphrase (assuan_context_t ctx, char *line)
 
 
 static const char hlp_clear_passphrase[] =
-  "CLEAR_PASSPHRASE <cache_id>\n"
+  "CLEAR_PASSPHRASE [--agent] <cache_id>\n"
   "\n"
   "may be used to invalidate the cache entry for a passphrase.  The\n"
-  "function returns with OK even when there is no cached passphrase.";
+  "function returns with OK even when there is no cached passphrase.\n"
+  "The --agent option is used to clear an entry for a cacheid added by\n"
+  "the agent.\n";
 static gpg_error_t
 cmd_clear_passphrase (assuan_context_t ctx, char *line)
 {
   char *cacheid = NULL;
   char *p;
+  int opt_agent;
+
+  opt_agent = has_option (line, "--agent");
+  line = skip_options (line);
 
   /* parse the stuff */
   for (p=line; *p == ' '; p++)
@@ -1287,7 +1293,8 @@ cmd_clear_passphrase (assuan_context_t ctx, char *line)
   if (!cacheid || !*cacheid || strlen (cacheid) > 50)
     return set_error (GPG_ERR_ASS_PARAMETER, "invalid length of cacheID");
 
-  agent_put_cache (cacheid, CACHE_MODE_USER, NULL, 0);
+  agent_put_cache (cacheid, opt_agent ? CACHE_MODE_NORMAL : CACHE_MODE_USER,
+	  NULL, 0);
   return 0;
 }
 

commit 2165925baeaa42f611b75718f3b2e9b37c53e417
Author: Werner Koch <wk at gnupg.org>
Date:   Wed Mar 2 09:04:16 2011 +0100

    Fix doc/Makefile target online

diff --git a/doc/Makefile.am b/doc/Makefile.am
index 17539fc..9c15c64 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -6,12 +6,12 @@
 # it under the terms of the GNU General Public License as published by
 # the Free Software Foundation; either version 3 of the License, or
 # (at your option) any later version.
-# 
+#
 # GnuPG is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 # GNU General Public License for more details.
-# 
+#
 # You should have received a copy of the GNU General Public License
 # along with this program; if not, see <http://www.gnu.org/licenses/>.
 
@@ -44,9 +44,9 @@ info_TEXINFOS = gnupg.texi
 dist_pkgdata_DATA = qualified.txt com-certs.pem $(helpfiles)
 
 nobase_dist_doc_DATA = FAQ DETAILS HACKING TRANSLATE OpenPGP KEYSERVER \
-                       $(examples)	
+                       $(examples)
 
-#dist_html_DATA = 
+#dist_html_DATA =
 
 
 gnupg_TEXINFOS = \
@@ -129,16 +129,16 @@ gnupg.texi : $(gnupg_TEXINFOS)
 online: gnupg.html gnupg.pdf
 	set -e; \
 	echo "Uploading current manuals to www.gnupg.org ..."; \
-	cp gnupg-logo.png gnupg.html/; \
+	cp $(srcdir)/gnupg-logo.png gnupg.html/; \
         user=werner ; dashdevel="" ; \
-        if echo "@PACKAGE_VERSION@" | grep -- "-svn" >/dev/null; then \
+        if echo "@PACKAGE_VERSION@" | grep -- "-git" >/dev/null; then \
 	  dashdevel="-devel" ; \
 	else \
           rsync -v gnupg.pdf $${user}@cvs.gnupg.org:webspace/manuals/ ; \
         fi ; \
 	cd gnupg.html ; \
         rsync -vr --exclude='.svn' .  \
-	  $${user}@cvs.gnupg.org:webspace/manuals/gnupg$${dashdevel}/ 
+	  $${user}@cvs.gnupg.org:webspace/manuals/gnupg$${dashdevel}/
 
 # Note that you need a recent version of emacs23 with org-mode 7.01h
 faq.txt faq.html: faq.org
@@ -160,4 +160,3 @@ faq-online: faq.txt faq.html
 	scp faq.html $${user}@ftp.gnupg.org:webspace/manuals/GnuPG-FAQ.html ; \
 	scp faq.txt  $${user}@ftp.gnupg.org:gcrypt/gnupg/GnuPG-FAQ.txt ; \
 	echo "...ready"
-

-----------------------------------------------------------------------

Summary of changes:
 agent/ChangeLog |    8 +++++-
 agent/command.c |   69 +++++++++++++++++++++++++++++++++++++++++++------------
 doc/Makefile.am |   15 +++++------
 3 files changed, 68 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list