[svn] gcry - r1215 - in trunk: . cipher tests

svn author wk cvs at cvs.gnupg.org
Thu Feb 22 19:25:31 CET 2007


Author: wk
Date: 2007-02-22 19:25:27 +0100 (Thu, 22 Feb 2007)
New Revision: 1215

Modified:
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/THANKS
   trunk/TODO
   trunk/cipher/ChangeLog
   trunk/cipher/md.c
   trunk/cipher/pubkey.c
   trunk/tests/ChangeLog
   trunk/tests/basic.c
   trunk/tests/pkbench.c
Log:
Fixed bug#596 adn minor cleanups


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/ChangeLog	2007-02-22 18:25:27 UTC (rev 1215)
@@ -1,11 +1,14 @@
 2007-02-22  Werner Koch  <wk at g10code.com>
 
+	* Makefile.am (DISTCHECK_CONFIGURE_FLAGS): Use
+	--enable-random-daemon.
+
 	* configure.ac: New option --enable-random-daemon.
 	Create versioninfo.rc and provide the build information.
 
 2007-02-21  Werner Koch  <wk at g10code.com>
 
-	* Makefile.am, configure.ac: Ignore w32-dll/
+	* Makefile.am, configure.ac: Ignore w32-dll/.
 
 2007-02-20  Werner Koch  <wk at g10code.com>
 

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/Makefile.am	2007-02-22 18:25:27 UTC (rev 1215)
@@ -19,6 +19,7 @@
 
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = dist-bzip2
+DISTCHECK_CONFIGURE_FLAGS = --enable-random-daemon
 
 DIST_SUBDIRS = m4 mpi cipher src doc tests
 SUBDIRS = mpi cipher src doc tests

Modified: trunk/THANKS
===================================================================
--- trunk/THANKS	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/THANKS	2007-02-22 18:25:27 UTC (rev 1215)
@@ -79,6 +79,7 @@
 Michael Sobolev 	   mss at despair.transas.com
 Michele Baldessari	   michele at pupazzo.org
 Modestas Vainius	   geromanas at mailas.com
+Neil Dunbar                neil.dunbar at pobox.com
 Neil Spring		   nspring at cs.washington.edu
 Newton Hammet              newton at hammet.net
 Nicolas Graner		   Nicolas.Graner at cri.u-psud.fr

Modified: trunk/TODO
===================================================================
--- trunk/TODO	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/TODO	2007-02-22 18:25:27 UTC (rev 1215)
@@ -2,8 +2,6 @@
 
 * Updated the FSF's directory.
 
-* Add more tests.
-
 * udiv-qrnbd.o should get build as *.lo [HPUX]
 
 * Allow operation using RSA keys consisting of the OpenSSL list of
@@ -14,15 +12,14 @@
   been compiled with thread support when used by a threaded
   application.
 
-* write an autoconf test to check whether the linker supports a
-  version script.
+* linker script test
+  Write an autoconf test to check whether the linker supports a
+  version script. 
 
 * Make use of the forthcoming visibility attribute.
 
 * Add attributes to the MPI functions.
 
-* Write tests for the progress function
-
 * In case the ac interface will be more popular than the pk interface,
   the asymmetric ciphers could be changed for convenient interaction
   with the ac interface (i.e. by using ac's `data sets') and the pk
@@ -39,8 +36,8 @@
 * Use builtin bit functions of gcc 3.4
 
 * Consider using a daemon to maintain he random pool
-
-  The down side of this is that we can't assume that the random das
+  [Partly done]
+  The down side of this is that we can't assume that the random has
   has always been stored in "secure memory".  And we rely on that
   sniffing of Unix domain sockets is not possible.  We can implement
   this simply by detecting a special prefixed random seed name and
@@ -56,9 +53,6 @@
   There is no shortage of standard memory, so logging is most likely
   possible.
 
-* signed vs. unsigned.
-  Sync the code with 1.2 where we have fixed all these issues.
-
 * mpi_print does not use secure memory
   for internal variables.
 
@@ -71,13 +65,18 @@
   Remove use of anonymous union.
 
 * ac.c
-  There are still some things fishy.  The fixes I did todat
+  There are still some things fishy.  The fixes I did today
   (2006-10-23) seem to cure just a symptom.  Needs a complete review.
 
 * gcryptrnd.c
-  Requires test for pth and other stuff.
+  Requires a test for pth [done] as well as some other tests.
 
 * secmem.c
   Check whether the memory block is valid before releasing it and
   print a diagnosic, like glibc does.
 
+* Tests
+  We need a lot more tests.  Lets keep an ever growing list here.
+** Write tests for the progress function
+
+

Modified: trunk/cipher/ChangeLog
===================================================================
--- trunk/cipher/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/cipher/ChangeLog	2007-02-22 18:25:27 UTC (rev 1215)
@@ -1,5 +1,8 @@
 2007-02-22  Werner Koch  <wk at g10code.com>
 
+	* pubkey.c (sexp_data_to_mpi): Handle dynamically allocated
+	algorithms.  Suggested by Neil Dunbar.  Fixes bug#596.
+
 	* rndw32.c (_gcry_rndw32_gather_random_fast): Make it return void.
 
 	* cipher.c (gcry_cipher_algo_name): Simplified.

Modified: trunk/cipher/md.c
===================================================================
--- trunk/cipher/md.c	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/cipher/md.c	2007-02-22 18:25:27 UTC (rev 1215)
@@ -303,7 +303,7 @@
   ret = search_oid (string, &algorithm, NULL);
   if (! ret)
     {
-      /* Not found, search for an acording diget name.  */
+      /* Not found, search a matching digest name.  */
       digest = gcry_md_lookup_name (string);
       if (digest)
 	{

Modified: trunk/cipher/pubkey.c
===================================================================
--- trunk/cipher/pubkey.c	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/cipher/pubkey.c	2007-02-22 18:25:27 UTC (rev 1215)
@@ -1325,12 +1325,32 @@
                    && !memcmp (hashnames[i].name, s, n))
                 break;
             }
+          if (hashnames[i].name)
+            algo = hashnames[i].algo;
+          else
+            {
+              /* In case of not listed or dynamically allocated hash
+                 algorithm we fall back to this somewhat slower
+                 method.  Further, it also allows to use OIDs as
+                 algorithm names. */
+              char *tmpname;
 
-          algo = hashnames[i].algo;
+              tmpname = gcry_malloc (n+1);
+              if (!tmpname)
+                algo = 0;  /* Out of core - silently give up.  */
+              else
+                {
+                  memcpy (tmpname, s, n);
+                  tmpname[n] = 0;
+                  algo = gcry_md_map_name (tmpname);
+                  gcry_free (tmpname);
+                }
+            }
+
           asnlen = DIM(asn);
           dlen = gcry_md_get_algo_dlen (algo);
 
-          if (!hashnames[i].name)
+          if (!algo)
             rc = GPG_ERR_DIGEST_ALGO;
           else if ( !(value=gcry_sexp_nth_data (lhash, 2, &valuelen))
                     || !valuelen )

Modified: trunk/tests/ChangeLog
===================================================================
--- trunk/tests/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/tests/ChangeLog	2007-02-22 18:25:27 UTC (rev 1215)
@@ -1,5 +1,7 @@
 2007-02-22  Werner Koch  <wk at g10code.com>
 
+	* basic.c (check_pubkey_sign): Also try signing using an OID.
+
 	* Makefile.am (TESTS) [W32]: Removed pkbench for now.
 	* pkbench.c (benchmark): Fixed for W32.
 

Modified: trunk/tests/basic.c
===================================================================
--- trunk/tests/basic.c	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/tests/basic.c	2007-02-22 18:25:27 UTC (rev 1215)
@@ -1654,6 +1654,12 @@
       { "(data\n (flags pkcs1)\n"
 	" (hash sha1 #11223344556677889900AABBCCDDEEFF10203040#))\n",
 	0 },
+      /* This test is to see whether hash algorithms not hard wired in
+         pubkey.c are detected:  */
+      { "(data\n (flags pkcs1)\n"
+	" (hash oid.1.3.14.3.2.29 "
+        "       #11223344556677889900AABBCCDDEEFF10203040#))\n",
+	0 },
       {	"(data\n (flags )\n"
 	" (hash sha1 #11223344556677889900AABBCCDDEEFF10203040#))\n",
 	GPG_ERR_CONFLICT },

Modified: trunk/tests/pkbench.c
===================================================================
--- trunk/tests/pkbench.c	2007-02-22 16:37:12 UTC (rev 1214)
+++ trunk/tests/pkbench.c	2007-02-22 18:25:27 UTC (rev 1215)
@@ -29,7 +29,7 @@
 #include <sys/stat.h>
 #ifndef HAVE_W32_SYSTEM
 #include <sys/times.h>
-#endif HAVE_W32_SYSTEM
+#endif /*HAVE_W32_SYSTEM*/
 #include <unistd.h>
 #include <fcntl.h>
 #include <time.h>




More information about the Gnupg-commits mailing list