[git] GnuPG - branch, master, updated. gnupg-2.1.7-3-gf126ca6

by Ben Kibbey cvs at cvs.gnupg.org
Sun Aug 16 00:25:24 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  f126ca61565922b3b938c3486614b9bd7e6e454c (commit)
       via  233b5fedabd80a34452e748132e65b5944310428 (commit)
      from  0675a3bd45b309f9a1fc27b86538f22afde7b3fc (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 f126ca61565922b3b938c3486614b9bd7e6e454c
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Thu Apr 16 21:00:30 2015 -0400

    Inform a user about inquire length limit.
    
    * common/status.h (INQUIRE_MAXLEN): New.
    * g10/call-agent.c (default_inquire_cb): Send STATUS_INQUIRE_MAXLEN.
    client when inquiring a passphrase over pinentry-loopback.
    
    --
    This is to inform a user about the maximum length of a passphrase. The
    limit is the same that gpg-agent uses.

diff --git a/common/status.h b/common/status.h
index 9219bf4..3c78eda 100644
--- a/common/status.h
+++ b/common/status.h
@@ -125,7 +125,9 @@ enum
     STATUS_PINENTRY_LAUNCHED,
 
     STATUS_ERROR,
-    STATUS_SUCCESS
+    STATUS_SUCCESS,
+
+    STATUS_INQUIRE_MAXLEN,
 };
 
 
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 0df572a..326eb82 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -177,11 +177,15 @@ default_inq_cb (void *opaque, const char *line)
       else
         {
           char *pw;
+          char buf[32];
 
           if (parm->keyinfo.keyid)
             emit_status_need_passphrase (parm->keyinfo.keyid,
                                          parm->keyinfo.mainkeyid,
                                          parm->keyinfo.pubkey_algo);
+
+          snprintf (buf, sizeof (buf), "%u", 100);
+          write_status_text (STATUS_INQUIRE_MAXLEN, buf);
           pw = cpr_get_hidden ("passphrase.enter", _("Enter passphrase: "));
           cpr_kill_prompt ();
           if (*pw == CONTROL_D && !pw[1])

commit 233b5fedabd80a34452e748132e65b5944310428
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Tue Apr 14 18:48:57 2015 -0400

    Allow --gen-key to inquire a passphrase.
    
    * g10/gpg.c (main): test for --command-fd during --gen-key parse.
    
    When --command-fd is set then imply --batch to let gpg inquire a
    passphrase rather than requiring a pinentry.

diff --git a/g10/gpg.c b/g10/gpg.c
index 10d8c20..0b3e924 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -3930,9 +3930,18 @@ main (int argc, char **argv)
 	    generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
 	}
 	else {
-	    if( argc )
-		wrong_args("--gen-key");
-	    generate_keypair (ctrl, 0, NULL, NULL, 0);
+            if (opt.command_fd != -1 && argc)
+              {
+                if( argc > 1 )
+                  wrong_args("--gen-key [parameterfile]");
+
+                opt.batch = 1;
+                generate_keypair (ctrl, 0, argc? *argv : NULL, NULL, 0);
+              }
+            else if (argc)
+              wrong_args ("--gen-key");
+            else
+              generate_keypair (ctrl, 0, NULL, NULL, 0);
 	}
 	break;
 

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

Summary of changes:
 common/status.h  |  4 +++-
 g10/call-agent.c |  4 ++++
 g10/gpg.c        | 15 ++++++++++++---
 3 files changed, 19 insertions(+), 4 deletions(-)


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




More information about the Gnupg-commits mailing list