[git] GnuPG - branch, master, updated. gnupg-2.1.0beta3-40-g3f7788f

by Ben Kibbey cvs at cvs.gnupg.org
Thu Feb 2 04:59:24 CET 2012


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  3f7788f2e035eb939abb27b3a53854ec0fc6178c (commit)
      from  2b3cb2ee94625498e7a7f939216c9bcddef6ec20 (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 3f7788f2e035eb939abb27b3a53854ec0fc6178c
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Wed Feb 1 21:38:13 2012 -0500

    Inform the client of the preset passphrase length.
    
    * agent/command.c (cmd_preset_passphrase): Send the INQUIRE_MAXLEN
    status message before inquiring the passphrase.

diff --git a/agent/command.c b/agent/command.c
index 5fa8bce..732046c 100644
--- a/agent/command.c
+++ b/agent/command.c
@@ -1696,7 +1696,13 @@ cmd_preset_passphrase (assuan_context_t ctx, char *line)
     {
       /* Note that the passphrase will be truncated at any null byte and the
        * limit is 480 characters. */
-      rc = assuan_inquire (ctx, "PASSPHRASE", &passphrase, &len, 480);
+      char buf[50];
+      size_t maxlen = 480;
+
+      snprintf (buf, sizeof (buf), "%u", maxlen);
+      rc = assuan_write_status (ctx, "INQUIRE_MAXLEN", buf);
+      if (!rc)
+	rc = assuan_inquire (ctx, "PASSPHRASE", &passphrase, &len, maxlen);
     }
   else
     rc = set_error (GPG_ERR_NOT_IMPLEMENTED, "passphrase is required");

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

Summary of changes:
 agent/command.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


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




More information about the Gnupg-commits mailing list