diff options
author | Werner Koch <wk@gnupg.org> | 2007-02-22 18:25:27 +0000 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2007-02-22 18:25:27 +0000 |
commit | 1cfac9fd5f628c2d505b6c01d2cc0657840299ed (patch) | |
tree | c6ceb5f8ac489a844041fb21d6d0cf296d78d694 | |
parent | 6cb0bbb9494b908be000d331d0e7068bb6ae9ee7 (diff) | |
download | libgcrypt-1cfac9fd5f628c2d505b6c01d2cc0657840299ed.tar.gz |
Fixed bug#596 adn minor cleanups
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | TODO | 25 | ||||
-rw-r--r-- | cipher/ChangeLog | 3 | ||||
-rw-r--r-- | cipher/md.c | 2 | ||||
-rw-r--r-- | cipher/pubkey.c | 24 | ||||
-rw-r--r-- | tests/ChangeLog | 2 | ||||
-rw-r--r-- | tests/basic.c | 6 | ||||
-rw-r--r-- | tests/pkbench.c | 2 |
10 files changed, 53 insertions, 18 deletions
@@ -1,11 +1,14 @@ 2007-02-22 Werner Koch <wk@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@g10code.com> - * Makefile.am, configure.ac: Ignore w32-dll/ + * Makefile.am, configure.ac: Ignore w32-dll/. 2007-02-20 Werner Koch <wk@g10code.com> diff --git a/Makefile.am b/Makefile.am index f706593c..085c5956 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 @@ -79,6 +79,7 @@ Michael Roth mroth@nessie.de Michael Sobolev mss@despair.transas.com Michele Baldessari michele@pupazzo.org Modestas Vainius geromanas@mailas.com +Neil Dunbar neil.dunbar at pobox.com Neil Spring nspring@cs.washington.edu Newton Hammet newton@hammet.net Nicolas Graner Nicolas.Graner@cri.u-psud.fr @@ -2,8 +2,6 @@ What's left to do -*- outline -*- * 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 @@ What's left to do -*- outline -*- 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 @@ What's left to do -*- outline -*- * 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 @@ What's left to do -*- outline -*- 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 @@ What's left to do -*- outline -*- 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 + + diff --git a/cipher/ChangeLog b/cipher/ChangeLog index 645d9ebb..b8ff7c5a 100644 --- a/cipher/ChangeLog +++ b/cipher/ChangeLog @@ -1,5 +1,8 @@ 2007-02-22 Werner Koch <wk@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. diff --git a/cipher/md.c b/cipher/md.c index 706d2744..28860135 100644 --- a/cipher/md.c +++ b/cipher/md.c @@ -303,7 +303,7 @@ gcry_md_map_name (const char *string) 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) { diff --git a/cipher/pubkey.c b/cipher/pubkey.c index 228b0d04..a833c3dd 100644 --- a/cipher/pubkey.c +++ b/cipher/pubkey.c @@ -1325,12 +1325,32 @@ sexp_data_to_mpi (gcry_sexp_t input, unsigned int nbits, gcry_mpi_t *ret_mpi, && !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; + + 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); + } + } - algo = hashnames[i].algo; 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 ) diff --git a/tests/ChangeLog b/tests/ChangeLog index 4dd2da24..07d5af04 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,7 @@ 2007-02-22 Werner Koch <wk@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. diff --git a/tests/basic.c b/tests/basic.c index f20f7b59..de4adeae 100644 --- a/tests/basic.c +++ b/tests/basic.c @@ -1654,6 +1654,12 @@ check_pubkey_sign (int n, gcry_sexp_t skey, gcry_sexp_t pkey) { "(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 }, diff --git a/tests/pkbench.c b/tests/pkbench.c index 5ce9b0e2..c6286c8e 100644 --- a/tests/pkbench.c +++ b/tests/pkbench.c @@ -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> |