[git] GnuPG - branch, master, updated. gnupg-2.1.5-30-g9bca96d

by Werner Koch cvs at cvs.gnupg.org
Mon Jun 29 12:53:07 CEST 2015


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  9bca96dbc5c32bdd00196462fde8c9ab94aeb28d (commit)
      from  7a387331645736eaeaaef57770beef5fa741bc22 (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 9bca96dbc5c32bdd00196462fde8c9ab94aeb28d
Author: Werner Koch <wk at gnupg.org>
Date:   Mon Jun 29 12:50:16 2015 +0200

    agent: Add --verify to the PASSWD command.
    
    * agent/command.c (cmd_passwd): Add option --verify.
    --
    
    GnuPG-bug-id: 1951
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/agent/command.c b/agent/command.c
index ccd5106..a4932ef 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1691,10 +1691,13 @@ cmd_learn (assuan_context_t ctx, char *line)
 
 

 static const char hlp_passwd[] =
-  "PASSWD [--cache-nonce=<c>] [--passwd-nonce=<s>] [--preset] <hexkeygrip>\n"
+  "PASSWD [--cache-nonce=<c>] [--passwd-nonce=<s>] [--preset]\n"
+  "       [--verify] <hexkeygrip>\n"
   "\n"
-  "Change the passphrase/PIN for the key identified by keygrip in LINE. When\n"
-  "--preset is used then the new passphrase will be added to the cache.\n";
+  "Change the passphrase/PIN for the key identified by keygrip in LINE.  If\n"
+  "--preset is used then the new passphrase will be added to the cache.\n"
+  "If --verify is used the command asks for the passphrase and verifies\n"
+  "that the passphrase valid.\n";
 static gpg_error_t
 cmd_passwd (assuan_context_t ctx, char *line)
 {
@@ -1708,13 +1711,14 @@ cmd_passwd (assuan_context_t ctx, char *line)
   unsigned char *shadow_info = NULL;
   char *passphrase = NULL;
   char *pend;
-  int opt_preset;
+  int opt_preset, opt_verify;
 
   if (ctrl->restricted)
     return leave_cmd (ctx, gpg_error (GPG_ERR_FORBIDDEN));
 
   opt_preset = has_option (line, "--preset");
   cache_nonce = option_value (line, "--cache-nonce");
+  opt_verify = has_option (line, "--verify");
   if (cache_nonce)
     {
       for (pend = cache_nonce; *pend && !spacep (pend); pend++)
@@ -1753,7 +1757,9 @@ cmd_passwd (assuan_context_t ctx, char *line)
     goto leave;
 
   ctrl->in_passwd++;
-  err = agent_key_from_file (ctrl, cache_nonce, ctrl->server_local->keydesc,
+  err = agent_key_from_file (ctrl,
+                             opt_verify? NULL : cache_nonce,
+                             ctrl->server_local->keydesc,
                              grip, &shadow_info, CACHE_MODE_IGNORE, NULL,
                              &s_skey, &passphrase);
   if (err)
@@ -1763,6 +1769,10 @@ cmd_passwd (assuan_context_t ctx, char *line)
       log_error ("changing a smartcard PIN is not yet supported\n");
       err = gpg_error (GPG_ERR_NOT_IMPLEMENTED);
     }
+  else if (opt_verify)
+    {
+      /* All done.  */
+    }
   else
     {
       char *newpass = NULL;

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

Summary of changes:
 agent/command.c | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)


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




More information about the Gnupg-commits mailing list