[svn] GnuPG - r4935 - trunk/agent

svn author wk cvs at cvs.gnupg.org
Mon Mar 2 11:26:37 CET 2009


Author: wk
Date: 2009-03-02 11:26:37 +0100 (Mon, 02 Mar 2009)
New Revision: 4935

Modified:
   trunk/agent/ChangeLog
   trunk/agent/protect-tool.c
Log:
Fix bug#1003.


Modified: trunk/agent/ChangeLog
===================================================================
--- trunk/agent/ChangeLog	2009-02-27 14:36:59 UTC (rev 4934)
+++ trunk/agent/ChangeLog	2009-03-02 10:26:37 UTC (rev 4935)
@@ -1,3 +1,9 @@
+2009-03-02  Werner Koch  <wk at g10code.com>
+
+	* protect-tool.c (import_p12_file): Take care of canceled
+	passphrase entry.  Fixes bug#1003.
+	(export_p12_file): Ditto.
+
 2008-12-17  Werner Koch  <wk at g10code.com>
 
 	* gpg-agent.c (handle_connections): Set action of all pth event

Modified: trunk/agent/protect-tool.c
===================================================================
--- trunk/agent/protect-tool.c	2009-02-27 14:36:59 UTC (rev 4934)
+++ trunk/agent/protect-tool.c	2009-03-02 10:26:37 UTC (rev 4935)
@@ -754,7 +754,11 @@
   gcry_sexp_release (s_key);
 
 
-  rc = agent_protect (key, (pw=get_new_passphrase (4)), &result, &resultlen);
+  pw = get_new_passphrase (4);
+  if (!pw)
+    rc = gpg_error (GPG_ERR_CANCELED);
+  else
+    rc = agent_protect (key, pw, &result, &resultlen);
   release_passphrase (pw);
   xfree (key);
   if (rc)
@@ -981,8 +985,11 @@
   kparms[7] = sk.u;
   kparms[8] = NULL;
 
-  key = p12_build (kparms, cert, certlen,
-                   (pw=get_new_passphrase (3)), opt_p12_charset, &keylen);
+  pw = get_new_passphrase (3);
+  if (!pw)
+    key = NULL;
+  else
+    key = p12_build (kparms, cert, certlen, pw, opt_p12_charset, &keylen);
   release_passphrase (pw);
   xfree (cert);
   for (i=0; i < 8; i++)




More information about the Gnupg-commits mailing list