[git] GCRYPT - branch, master, updated. libgcrypt-1.6.0-51-gcbdc355

by Werner Koch cvs at cvs.gnupg.org
Tue Jan 28 13:04:34 CET 2014


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 crypto library".

The branch, master has been updated
       via  cbdc355415f83ed62da4f3618767eba54d7e6d37 (commit)
       via  7460e9243b3cc050631c37ed4f2713ae7bcb6762 (commit)
       via  3caa0f1319dc4779e0d6eee4460c1af2a12b2c3c (commit)
      from  5c150ece094bf0a504a111ce6c7b72e8d0b0457a (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 cbdc355415f83ed62da4f3618767eba54d7e6d37
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Jan 9 19:14:09 2014 +0100

    sexp: Fix broken gcry_sexp_nth.
    
    * src/sexp.c (_gcry_sexp_nth): Return a valid S-expression for a data
    element.
    (NODE): Remove unused typedef.
    (ST_HINT): Comment unused macro.
    
    * tests/t-sexp.c (bug_1594): New.
    (main): Run new test.
    --
    
    Before 1.6.0 gcry_sexp_nth (list, 0) with a LIST of "(a (b 3:pqr) (c
    3:456) (d 3:xyz))" returned the entire list.  1.6.0 instead returned
    NULL.  However, this is also surprising and the expected value would
    be "(a)".  This patch fixes this.
    
    Somewhat related to that gcry_sexp_nth returned a broken list if
    requesting index 1 of a list like "(n foo)".  It returned just the
    "foo" but not as a list which is required by the S-expression specs.
    Due to this patch the returned value is now "(foo)".
    
    Thanks to Ludovic Courtès for pointing out these problems.
    
    GnuPG-bug-id: 1594

diff --git a/doc/gcrypt.texi b/doc/gcrypt.texi
index 4a91790..c5c3b45 100644
--- a/doc/gcrypt.texi
+++ b/doc/gcrypt.texi
@@ -4064,8 +4064,9 @@ no such element, @code{NULL} is returned.
 @deftypefun gcry_sexp_t gcry_sexp_car (@w{const gcry_sexp_t @var{list}})
 
 Create and return a new S-expression from the first element in
- at var{list}; this called the "type" and should always exist and be a
-string. @code{NULL} is returned in case of a problem.
+ at var{list}; this is called the "type" and should always exist per
+S-expression specification and in general be a string.  @code{NULL} is
+returned in case of a problem.
 @end deftypefun
 
 @deftypefun gcry_sexp_t gcry_sexp_cdr (@w{const gcry_sexp_t @var{list}})
diff --git a/src/sexp.c b/src/sexp.c
index f31da00..0e4af52 100644
--- a/src/sexp.c
+++ b/src/sexp.c
@@ -1,7 +1,7 @@
 /* sexp.c  -  S-Expression handling
  * Copyright (C) 1999, 2000, 2001, 2002, 2003,
  *               2004, 2006, 2007, 2008, 2011  Free Software Foundation, Inc.
- * Copyright (C) 2013 g10 Code GmbH
+ * Copyright (C) 2013, 2014 g10 Code GmbH
  *
  * This file is part of Libgcrypt.
  *
@@ -32,7 +32,55 @@
 #define GCRYPT_NO_MPI_MACROS 1
 #include "g10lib.h"
 
-typedef struct gcry_sexp *NODE;
+
+/* Notes on the internal memory layout.
+
+   We store an S-expression as one memory buffer with tags, length and
+   value.  The simplest list would thus be:
+
+   /----------+----------+---------+------+-----------+----------\
+   | open_tag | data_tag | datalen | data | close_tag | stop_tag |
+   \----------+----------+---------+------+-----------+----------/
+
+   Expressed more compact and with an example:
+
+   /----+----+----+---+----+----\
+   | OT | DT | DL | D | CT | ST |  "(foo)"
+   \----+----+----+---+----+----/
+
+   The open tag must always be the first tag of a list as requires by
+   the S-expression specs.  At least data element (data_tag, datalen,
+   data) is required as well.  The close_tag finishes the list and
+   would actually be sufficient.  For fail-safe reasons a final stop
+   tag is always the last byte in a buffer; it has a value of 0 so
+   that string function accidently applied to an S-expression will
+   never access unallocated data.  We do not support display hints and
+   thus don't need to represent them.  A list may have more an
+   arbitrary number of data elements but at least one is required.
+   The length of each data must be greater than 0 and has a current
+   limit to 65535 bytes (by means of the DATALEN type).
+
+   A list with two data elements:
+
+   /----+----+----+---+----+----+---+----+----\
+   | OT | DT | DL | D | DT | DL | D | CT | ST |  "(foo bar)"
+   \----+----+----+---+----+----+---+----+----/
+
+   In the above example both DL fields have a value of 3.
+   A list of a list with one data element:
+
+   /----+----+----+----+---+----+----+----\
+   | OT | OT | DT | DL | D | CT | CT | ST |  "((foo))"
+   \----+----+----+----+---+----+----+----/
+
+   A list with one element followed by another list:
+
+   /----+----+----+---+----+----+----+---+----+----+----\
+   | OT | DT | DL | D | OT | DT | DL | D | CT | CT | ST |  "(foo (bar))"
+   \----+----+----+---+----+----+----+---+----+----+----/
+
+ */
+
 typedef unsigned short DATALEN;
 
 struct gcry_sexp
@@ -42,11 +90,11 @@ struct gcry_sexp
 
 #define ST_STOP  0
 #define ST_DATA  1  /* datalen follows */
-#define ST_HINT  2  /* datalen follows */
+/*#define ST_HINT  2   datalen follows (currently not used) */
 #define ST_OPEN  3
 #define ST_CLOSE 4
 
-/* the atoi macros assume that the buffer has only valid digits */
+/* The atoi macros assume that the buffer has only valid digits.  */
 #define atoi_1(p)   (*(p) - '0' )
 #define xtoi_1(p)   (*(p) <= '9'? (*(p)- '0'): \
                      *(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10))
@@ -167,9 +215,10 @@ _gcry_sexp_dump (const gcry_sexp_t a)
     }
 }
 
-/****************
- * Pass list through except when it is an empty list - in that case
- * return NULL and release the passed list.
+
+/* Pass list through except when it is an empty list - in that case
+ * return NULL and release the passed list.  This is used to make sure
+ * that no forbidden empty lists are created.
  */
 static gcry_sexp_t
 normalize ( gcry_sexp_t list )
@@ -501,7 +550,7 @@ _gcry_sexp_length (const gcry_sexp_t list)
 
 
 /* Return the internal lengths offset of LIST.  That is the size of
-   the buffer from the first ST_OPEN, which is retruned at R_OFF, to
+   the buffer from the first ST_OPEN, which is returned at R_OFF, to
    the corresponding ST_CLOSE inclusive.  */
 static size_t
 get_internal_buffer (const gcry_sexp_t list, size_t *r_off)
@@ -542,8 +591,8 @@ get_internal_buffer (const gcry_sexp_t list, size_t *r_off)
 
 
 
-/* Extract the CAR of the given list.  May return NULL for bad lists
-   or memory failure.  */
+/* Extract the n-th element of the given LIST.  Returns NULL for
+   no-such-element, a corrupt list, or memory failure.  */
 gcry_sexp_t
 _gcry_sexp_nth (const gcry_sexp_t list, int number)
 {
@@ -587,15 +636,16 @@ _gcry_sexp_nth (const gcry_sexp_t list, int number)
 
   if (*p == ST_DATA)
     {
-      memcpy (&n, p, sizeof n);
-      p += sizeof n;
-      newlist = xtrymalloc (sizeof *newlist + n + 1);
+      memcpy (&n, p+1, sizeof n);
+      newlist = xtrymalloc (sizeof *newlist + 1 + 1 + sizeof n + n + 1);
       if (!newlist)
         return NULL;
       d = newlist->d;
-      memcpy (d, p, n);
-      d += n;
-      *d++ = ST_STOP;
+      *d++ = ST_OPEN;
+      memcpy (d, p, 1 + sizeof n + n);
+      d += 1 + sizeof n + n;
+      *d++ = ST_CLOSE;
+      *d = ST_STOP;
     }
   else if (*p == ST_OPEN)
     {
@@ -639,6 +689,7 @@ _gcry_sexp_nth (const gcry_sexp_t list, int number)
   return normalize (newlist);
 }
 
+
 gcry_sexp_t
 _gcry_sexp_car (const gcry_sexp_t list)
 {
diff --git a/tests/t-sexp.c b/tests/t-sexp.c
index 3510382..1051723 100644
--- a/tests/t-sexp.c
+++ b/tests/t-sexp.c
@@ -978,6 +978,74 @@ check_extract_param (void)
 }
 
 
+/* A test based on bug 1594.  */
+static void
+bug_1594 (void)
+{
+static char thing[] =
+  "(signature"
+  " (public-key"
+  "  (rsa"
+  "   (n #00A53A6B3A50BE571F805BD98ECE1FCE4CE291C3D4D3E971740E1EE6D447F526"
+  "       6AC8973DDC82F0ADD234CC82E0A0A3F48B81ACC8B038DB8ACC3E78DC2ED2642F"
+  "       6BA353FCA60F47C2801DEB477B37FB8B2F5508AA1C6D922780DB142DEA19B812"
+  "       C4E64F1138AD3BD61C58DB2D2591BE0BF36A1AC588AA45763BCDFF581050ABA8"
+  "       CA47BD9723ADD6A308AE28471EDD2B16D03C941D4F2B7E019C43AF8972880633"
+  "       54E97B7E19F1677D84B69A26B184A77B719DD72C48E0EE36107046F786566A9D"
+  "       13BAD724D6D78F24700FC22FC000E1B2A8C1B08ED62008395B0764CD9B55E80D"
+  "       A0A2B61C698DC27EA98E68BB576ACFC2B91B4D7283E7D960948D049D6E3C4CB1"
+  "       F489B460A120A4BB6C04A843FD3A67454136DE61CF68A927871EFFA9141BD372"
+  "       A748593C703E0301F039A9E674C50301BFC385BABE5B154250E7D57B82DB31F1"
+  "       E1AC696F870DCD8FE8DEC75608B988FCA3B484F1FD7755BF452F99597269AF02"
+  "       E8AF87D0F93DB427291659183D077254C835BFB6DDFD87CD0B5E0738682FCD34"
+  "       923F22551F73944E6CBE3ED6879B4414676B5DA0F30ED21DFA12BD2230C3C5D2"
+  "       EA116A3EFEB4AEC21C58E63FAFA549A63190F01859445E9B80F427B80FD4C884"
+  "       2AD41FE760A3E9DEDFB56CEBE8EA783838B2B392CACDDC760CCE212E388AFBC1"
+  "       95DC6D0ED87E9091F82A82CE372738C8DE8ABD76ACD06AC8B80AA0597162DF59"
+  "       67#)"
+  "   (e #010001#))))";
+  gcry_sexp_t sig, pubkey, n, n_val;
+
+  info ("checking fix for bug 1594\n");
+
+  if (gcry_sexp_new (&sig, thing, 0, 1))
+    die ("scanning fixed string failed\n");
+  pubkey = gcry_sexp_find_token (sig, "public-key", 0);
+  gcry_sexp_release (sig);
+  if (!pubkey)
+    {
+      fail ("'public-key' token not found");
+      return;
+    }
+  n = gcry_sexp_find_token (pubkey, "n", 0);
+  if (!n)
+    {
+      fail ("'n' token not found");
+      gcry_sexp_release (pubkey);
+      return;
+    }
+  n_val = gcry_sexp_nth (n, 1);
+  /* Bug 1594 would require the following test:
+   *   if (n_val)
+   *     fail ("extracting 1-th of 'n' list did not fail");
+   * However, we meanwhile modified the S-expression functions to
+   * behave like Scheme to allow the access of any element of a list.
+   */
+  if (!n_val)
+    fail ("extracting 1-th of 'n' list failed");
+  /*gcry_log_debugsxp ("1-th", n_val); => "(#00A5...#)"  */
+  gcry_sexp_release (n_val);
+  n_val = gcry_sexp_nth (n, 2);
+  if (n_val)
+    fail ("extracting 2-th of 'n' list did not fail");
+  n_val = gcry_sexp_nth (n, 0);
+  if (!n_val)
+    fail ("extracting 0-th of 'n' list failed");
+  /*gcry_log_debugsxp ("0-th", n_val); => "(n)"  */
+  if (gcry_sexp_nth (n_val, 1))
+    fail ("extracting 1-th of car of 'n' list did not fail");
+  gcry_sexp_release (n_val);
+}
 
 
 int
@@ -1040,6 +1108,7 @@ main (int argc, char **argv)
   back_and_forth ();
   check_sscan ();
   check_extract_param ();
+  bug_1594 ();
 
   return errorcount? 1:0;
 }

commit 7460e9243b3cc050631c37ed4f2713ae7bcb6762
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Jan 9 19:14:09 2014 +0100

    tests: Improve t-common.h.
    
    * tests/t-common.h: Add couple of macros.  Check that config.h has
    been included.
    (show): Rename to info.
    * tests/t-lock.c, tests/t-sexp.c: Adjust for changes.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/tests/t-common.h b/tests/t-common.h
index 288963d..3546986 100644
--- a/tests/t-common.h
+++ b/tests/t-common.h
@@ -21,16 +21,39 @@
 
 #include "../src/gcrypt.h"
 
-#ifndef PGM
-# error Macro PGM not defined.
+#ifndef PGMNAME
+# error Macro PGMNAME not defined.
 #endif
+#ifndef _GCRYPT_CONFIG_H_INCLUDED
+# error config.h not included
+#endif
+
+/* A couple of useful macros.  */
+#ifndef DIM
+# define DIM(v)		     (sizeof(v)/sizeof((v)[0]))
+#endif
+#define my_isascii(c) (!((c) & 0x80))
+#define digitp(p)     (*(p) >= '0' && *(p) <= '9')
+#define hexdigitp(a)  (digitp (a)                     \
+                       || (*(a) >= 'A' && *(a) <= 'F')  \
+                       || (*(a) >= 'a' && *(a) <= 'f'))
+#define xtoi_1(p)     (*(p) <= '9'? (*(p)- '0'): \
+                       *(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10))
+#define xtoi_2(p)     ((xtoi_1(p) * 16) + xtoi_1((p)+1))
+#define xmalloc(a)    gcry_xmalloc ((a))
+#define xcalloc(a,b)  gcry_xcalloc ((a),(b))
+#define xstrdup(a)    gcry_xstrdup ((a))
+#define xfree(a)      gcry_free ((a))
+#define pass()        do { ; } while (0)
 
 
+/* Standard global variables.  */
 static int verbose;
 static int debug;
 static int errorcount;
 
 
+/* Reporting functions.  */
 static void
 die (const char *format, ...)
 {
@@ -40,7 +63,7 @@ die (const char *format, ...)
 #ifdef HAVE_FLOCKFILE
   flockfile (stderr);
 #endif
-  fprintf (stderr, "%s: ", PGM);
+  fprintf (stderr, "%s: ", PGMNAME);
   va_start (arg_ptr, format) ;
   vfprintf (stderr, format, arg_ptr);
   va_end (arg_ptr);
@@ -62,7 +85,7 @@ fail (const char *format, ...)
 #ifdef HAVE_FLOCKFILE
   flockfile (stderr);
 #endif
-  fprintf (stderr, "%s: ", PGM);
+  fprintf (stderr, "%s: ", PGMNAME);
   va_start (arg_ptr, format);
   vfprintf (stderr, format, arg_ptr);
   va_end (arg_ptr);
@@ -78,7 +101,7 @@ fail (const char *format, ...)
 
 
 static void
-show (const char *format, ...)
+info (const char *format, ...)
 {
   va_list arg_ptr;
 
@@ -87,7 +110,7 @@ show (const char *format, ...)
 #ifdef HAVE_FLOCKFILE
   flockfile (stderr);
 #endif
-  fprintf (stderr, "%s: ", PGM);
+  fprintf (stderr, "%s: ", PGMNAME);
   va_start (arg_ptr, format);
   vfprintf (stderr, format, arg_ptr);
   if (*format && format[strlen(format)-1] != '\n')
diff --git a/tests/t-lock.c b/tests/t-lock.c
index c6c1e41..22b67ef 100644
--- a/tests/t-lock.c
+++ b/tests/t-lock.c
@@ -31,7 +31,7 @@
 # include <pthread.h>
 #endif
 
-#define PGM "t-lock"
+#define PGMNAME "t-lock"
 
 #include "t-common.h"
 
@@ -152,7 +152,7 @@ nonce_thread (void *argarg)
     {
       gcry_create_nonce (nonce, sizeof nonce);
       if (i && !(i%100))
-        show ("thread %d created %d nonces so far", arg->no, i);
+        info ("thread %d created %d nonces so far", arg->no, i);
     }
 
   gcry_free (arg);
@@ -186,7 +186,7 @@ check_nonce_lock (void)
     {
       rc = WaitForSingleObject (threads[i], INFINITE);
       if (rc == WAIT_OBJECT_0)
-        show ("nonce thread %d has terminated", i);
+        info ("nonce thread %d has terminated", i);
       else
         fail ("waiting for nonce thread %d failed: %d",
               i, (int)GetLastError ());
@@ -211,7 +211,7 @@ check_nonce_lock (void)
         fail ("pthread_join failed for nonce thread %d: %s",
               i, strerror (errno));
       else
-        show ("nonce thread %d has terminated", i);
+        info ("nonce thread %d has terminated", i);
     }
 
 #endif /*!_WIN32*/
@@ -345,7 +345,7 @@ run_test (void)
     {
       rc = WaitForSingleObject (athreads[i], INFINITE);
       if (rc == WAIT_OBJECT_0)
-        show ("accountant thread %d has terminated", i);
+        info ("accountant thread %d has terminated", i);
       else
         fail ("waiting for accountant thread %d failed: %d",
               i, (int)GetLastError ());
@@ -355,7 +355,7 @@ run_test (void)
 
   rc = WaitForSingleObject (rthread, INFINITE);
   if (rc == WAIT_OBJECT_0)
-    show ("revision thread has terminated");
+    info ("revision thread has terminated");
   else
     fail ("waiting for revision thread failed: %d", (int)GetLastError ());
   CloseHandle (rthread);
@@ -379,7 +379,7 @@ run_test (void)
         fail ("pthread_join failed for accountant thread %d: %s",
               i, strerror (errno));
       else
-        show ("accountant thread %d has terminated", i);
+        info ("accountant thread %d has terminated", i);
     }
 
   stop_revision_thread = 1;
@@ -387,7 +387,7 @@ run_test (void)
   if (rc)
     fail ("pthread_join failed for the revision thread: %s", strerror (errno));
   else
-    show ("revision thread has terminated");
+    info ("revision thread has terminated");
 
 #endif /*!_WIN32*/
 
@@ -438,6 +438,9 @@ main (int argc, char **argv)
   gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
   if (!gcry_check_version (GCRYPT_VERSION))
     die ("version mismatch");
+  /* We are using non-public interfaces - check the exact version.  */
+  if (strcmp (gcry_check_version (NULL), GCRYPT_VERSION))
+    die ("exact version match failed");
   gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
   gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 
diff --git a/tests/t-sexp.c b/tests/t-sexp.c
index 4c48277..3510382 100644
--- a/tests/t-sexp.c
+++ b/tests/t-sexp.c
@@ -1,5 +1,6 @@
 /* t-sexp.c  -  S-expression regression tests
- *	Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+ * Copyright (C) 2014 g10 Code GmbH
  *
  * This file is part of Libgcrypt.
  *
@@ -14,8 +15,7 @@
  * GNU Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ * License along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -29,72 +29,7 @@
 #include "../src/gcrypt-int.h"
 
 #define PGMNAME "t-sexp"
-
-#ifndef DIM
-# define DIM(v)		     (sizeof(v)/sizeof((v)[0]))
-#endif
-#define my_isascii(c) (!((c) & 0x80))
-#define digitp(p)     (*(p) >= '0' && *(p) <= '9')
-#define hexdigitp(a)  (digitp (a)                     \
-                       || (*(a) >= 'A' && *(a) <= 'F')  \
-                       || (*(a) >= 'a' && *(a) <= 'f'))
-#define xtoi_1(p)     (*(p) <= '9'? (*(p)- '0'): \
-                       *(p) <= 'F'? (*(p)-'A'+10):(*(p)-'a'+10))
-#define xtoi_2(p)     ((xtoi_1(p) * 16) + xtoi_1((p)+1))
-#define xmalloc(a)    gcry_xmalloc ((a))
-#define xcalloc(a,b)  gcry_xcalloc ((a),(b))
-#define xstrdup(a)    gcry_xstrdup ((a))
-#define xfree(a)      gcry_free ((a))
-#define pass()        do { ; } while (0)
-
-
-static int verbose;
-static int error_count;
-
-static void
-die (const char *format, ...)
-{
-  va_list arg_ptr ;
-
-  fflush (stdout);
-  fprintf (stderr, "%s: ", PGMNAME);
-  va_start( arg_ptr, format ) ;
-  vfprintf (stderr, format, arg_ptr );
-  va_end(arg_ptr);
-  if (*format && format[strlen(format)-1] != '\n')
-    putc ('\n', stderr);
-  exit (1);
-}
-
-static void
-info (const char *format, ...)
-{
-  va_list arg_ptr;
-
-  if (verbose)
-    {
-      va_start( arg_ptr, format ) ;
-      vfprintf (stderr, format, arg_ptr );
-      va_end(arg_ptr);
-      if (*format && format[strlen(format)-1] != '\n')
-        putc ('\n', stderr);
-    }
-}
-
-static void
-fail ( const char *format, ... )
-{
-    va_list arg_ptr ;
-
-    fputs (PGMNAME ": ", stderr);
-    va_start( arg_ptr, format ) ;
-    vfprintf (stderr, format, arg_ptr );
-    va_end(arg_ptr);
-    if (*format && format[strlen(format)-1] != '\n')
-      putc ('\n', stderr);
-    error_count++;
-}
-
+#include "t-common.h"
 
 
 /* Convert STRING consisting of hex characters into its binary
@@ -1043,14 +978,62 @@ check_extract_param (void)
 }
 
 
+
+
 int
 main (int argc, char **argv)
 {
-  if (argc > 1 && !strcmp (argv[1], "--verbose"))
-    verbose = 1;
+  int last_argc = -1;
+
+  if (argc)
+    {
+      argc--; argv++;
+    }
+  while (argc && last_argc != argc )
+    {
+      last_argc = argc;
+      if (!strcmp (*argv, "--"))
+        {
+          argc--; argv++;
+          break;
+        }
+      else if (!strcmp (*argv, "--help"))
+        {
+          puts (
+"usage: " PGMNAME " [options]\n"
+"\n"
+"Options:\n"
+"  --verbose      Show what is going on\n"
+"  --debug        Flyswatter\n"
+);
+          exit (0);
+        }
+      else if (!strcmp (*argv, "--verbose"))
+        {
+          verbose = 1;
+          argc--; argv++;
+        }
+      else if (!strcmp (*argv, "--debug"))
+        {
+          verbose = debug = 1;
+          argc--; argv++;
+        }
+      else if (!strncmp (*argv, "--", 2))
+        die ("unknown option '%s'", *argv);
+    }
 
+  if (debug)
+    gcry_control (GCRYCTL_SET_DEBUG_FLAGS, 1u, 0);
   gcry_control (GCRYCTL_DISABLE_SECMEM_WARN);
   gcry_control (GCRYCTL_INIT_SECMEM, 16384, 0);
+  if (!gcry_check_version (GCRYPT_VERSION))
+    die ("version mismatch");
+  /* #include "../src/gcrypt-int.h" indicates that internal interfaces
+     may be used; thus better do an exact version check. */
+  if (strcmp (gcry_check_version (NULL), GCRYPT_VERSION))
+    die ("exact version match failed");
+  gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
+  gcry_control (GCRYCTL_INITIALIZATION_FINISHED, 0);
 
   basic ();
   canon_len ();
@@ -1058,5 +1041,5 @@ main (int argc, char **argv)
   check_sscan ();
   check_extract_param ();
 
-  return error_count? 1:0;
+  return errorcount? 1:0;
 }

commit 3caa0f1319dc4779e0d6eee4460c1af2a12b2c3c
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Jan 9 19:14:09 2014 +0100

    mpi: Minor fix for Atari-mint.
    
    * mpi/config.links [m68k-atari-mint]: Do not assume 68020.  Suggested
    by Alan Hourihane.
    
    (cherry picked from commit 420f42a5752e90a8b27d58ffa1ddfe6e4ab341e8)

diff --git a/mpi/config.links b/mpi/config.links
index 57e6c2a..0217d35 100644
--- a/mpi/config.links
+++ b/mpi/config.links
@@ -260,7 +260,7 @@ case "${host}" in
     m68k-atari-mint)
 	echo '#define MIT_SYNTAX'           >>./mpi/asm-syntax.h
 	cat  $srcdir/mpi/m68k/syntax.h	    >>./mpi/asm-syntax.h
-	path="m68k/mc68020 m68k"
+	path="m68k"
         mpi_cpu_arch="m68k"
 	;;
     m68000*-*-* | \

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

Summary of changes:
 doc/gcrypt.texi  |    5 +-
 mpi/config.links |    2 +-
 src/sexp.c       |   83 ++++++++++++++++++-----
 tests/t-common.h |   35 ++++++++--
 tests/t-lock.c   |   19 +++---
 tests/t-sexp.c   |  196 ++++++++++++++++++++++++++++++++++--------------------
 6 files changed, 235 insertions(+), 105 deletions(-)


hooks/post-receive
-- 
The GNU crypto library
http://git.gnupg.org


_______________________________________________
Gnupg-commits mailing list
Gnupg-commits at gnupg.org
http://lists.gnupg.org/mailman/listinfo/gnupg-commits


More information about the Gcrypt-devel mailing list