[git] GnuPG - branch, master, updated. post-nuke-of-trailing-ws-95-g0dcf517

by Ben Kibbey cvs at cvs.gnupg.org
Tue Sep 13 09:54:20 CEST 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  0dcf517700387e75ce46c28993f882031e34c816 (commit)
       via  eb5709f554440e20f00603c5016b10aa44e61983 (commit)
      from  57ef0d608717cc6160c4260f31439dadcd14b1c3 (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 0dcf517700387e75ce46c28993f882031e34c816
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Mon Sep 12 20:13:19 2011 -0400

    Allow no protection in pinentry-mode=loopback.
    
    When the inquired passphrase has a 0 length then treat it as no
    protection.

diff --git a/agent/ChangeLog b/agent/ChangeLog
index 18a9491..3c52e1f 100644
--- a/agent/ChangeLog
+++ b/agent/ChangeLog
@@ -1,3 +1,8 @@
+2011-09-12  Ben Kibbey <bjk at luxsci.net>
+
+	* genkey.c (agent_ask_new_passphrase): Allow for an empty passphrase
+	(no protection) in PINENTRY_MODE_LOOPBACK.
+
 2011-09-10  Ben Kibbey <bjk at luxsci.net>
 
 	* agent.h (pinentry_loopback): New prototype.
diff --git a/agent/genkey.c b/agent/genkey.c
index b022684..20b9230 100644
--- a/agent/genkey.c
+++ b/agent/genkey.c
@@ -313,8 +313,13 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt,
 	err = pinentry_loopback(ctrl, "NEW_PASSPHRASE", &buffer, &size, len);
 	if (!err)
 	  {
-	    buffer[size] = 0;
-	    *r_passphrase = buffer;
+	    if (size)
+	      {
+		buffer[size] = 0;
+		*r_passphrase = buffer;
+	      }
+	    else
+	        *r_passphrase = NULL;
 	  }
 	return err;
     }

commit eb5709f554440e20f00603c5016b10aa44e61983
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Mon Sep 12 20:13:18 2011 -0400

    Fixed invalid free.

diff --git a/agent/genkey.c b/agent/genkey.c
index 85ba702..b022684 100644
--- a/agent/genkey.c
+++ b/agent/genkey.c
@@ -311,9 +311,7 @@ agent_ask_new_passphrase (ctrl_t ctrl, const char *prompt,
 	unsigned char *buffer;
 
 	err = pinentry_loopback(ctrl, "NEW_PASSPHRASE", &buffer, &size, len);
-	if (err)
-	  xfree(buffer);
-	else
+	if (!err)
 	  {
 	    buffer[size] = 0;
 	    *r_passphrase = buffer;

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

Summary of changes:
 agent/ChangeLog |    5 +++++
 agent/genkey.c  |   13 ++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)


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




More information about the Gnupg-commits mailing list