[svn] GnuPG - r3896 - in trunk: . g10

svn author wk cvs at cvs.gnupg.org
Tue Sep 20 10:19:51 CEST 2005


Author: wk
Date: 2005-09-20 10:19:50 +0200 (Tue, 20 Sep 2005)
New Revision: 3896

Modified:
   trunk/TODO
   trunk/configure.ac
   trunk/g10/ChangeLog
   trunk/g10/mainproc.c
Log:
* mainproc.c (proc_symkey_enc): Take care of a canceled passphrase
prompt.


Modified: trunk/TODO
===================================================================
--- trunk/TODO	2005-09-20 03:34:32 UTC (rev 3895)
+++ trunk/TODO	2005-09-20 08:19:50 UTC (rev 3896)
@@ -75,4 +75,7 @@
 
   * Delete a card key as well as a wiping.
 
-  * Make 2 strings translatable in export.c after releasing 1.4.2.
+  * passphrase_to_dek does not return NULL after a cancel.  There is
+    no way to issue a cancel when unsing the CLI - this would however
+    be a Good Thing when used with mixed symkey/pubkey encrypted
+    messages. See comment in mainproc.c:proc_symkey_enc. 

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2005-09-20 03:34:32 UTC (rev 3895)
+++ trunk/configure.ac	2005-09-20 08:19:50 UTC (rev 3896)
@@ -102,8 +102,8 @@
     AC_DEFINE(M_GUARD,1,[Define to use the (obsolete) malloc guarding feature])
 fi
 
-# We don't have a test to check whetyer as(1) knows about the
-# non executable stackioption.  Thus we provide an option to enable
+# We don't have a test to check whether as(1) knows about the
+# non executable stack option.  Thus we provide an option to enable
 # it.
 AC_MSG_CHECKING([whether non excutable stack support is requested])
 AC_ARG_ENABLE(noexecstack,

Modified: trunk/g10/ChangeLog
===================================================================
--- trunk/g10/ChangeLog	2005-09-20 03:34:32 UTC (rev 3895)
+++ trunk/g10/ChangeLog	2005-09-20 08:19:50 UTC (rev 3896)
@@ -1,3 +1,8 @@
+2005-09-20  Werner Koch  <wk at g10code.com>
+
+	* mainproc.c (proc_symkey_enc): Take care of a canceled passphrase
+	prompt.
+
 2005-09-19  David Shaw  <dshaw at jabberwocky.com>
 
 	* keylist.c (reorder_keyblock, do_reorder_keyblock): Reorder

Modified: trunk/g10/mainproc.c
===================================================================
--- trunk/g10/mainproc.c	2005-09-20 03:34:32 UTC (rev 3895)
+++ trunk/g10/mainproc.c	2005-09-20 08:19:50 UTC (rev 3896)
@@ -327,8 +327,23 @@
 	  }
 	else
 	  {
-	    c->dek=passphrase_to_dek(NULL, 0, algo, &enc->s2k, 0, NULL, NULL);
+            int canceled;
 
+	    c->dek = passphrase_to_dek (NULL, 0, algo, &enc->s2k, 0,
+                                        NULL, &canceled);
+            if (canceled)
+              {
+                /* For unknown reasons passphrase_to_dek does only
+                   return NULL if a new passphrase has been requested
+                   and has not been repeated correctly.  Thus even
+                   with a cancel requested (by means of the gpg-agent)
+                   it won't return NULL but an empty passphrase.  We
+                   take the most conservative approach for now and
+                   work around it right here. */
+                xfree (c->dek);
+                c->dek = NULL;
+              }
+
 	    if(c->dek)
 	      {
 		c->dek->symmetric=1;




More information about the Gnupg-commits mailing list