[svn] gcry - r1214 - in trunk: . cipher doc m4 src tests

svn author wk cvs at cvs.gnupg.org
Thu Feb 22 17:37:14 CET 2007


Author: wk
Date: 2007-02-22 17:37:12 +0100 (Thu, 22 Feb 2007)
New Revision: 1214

Modified:
   trunk/
   trunk/ChangeLog
   trunk/Makefile.am
   trunk/NEWS
   trunk/README
   trunk/autogen.sh
   trunk/cipher/ChangeLog
   trunk/cipher/Makefile.am
   trunk/cipher/cipher.c
   trunk/cipher/rand-internal.h
   trunk/cipher/random.c
   trunk/cipher/random.h
   trunk/cipher/rndw32.c
   trunk/configure.ac
   trunk/doc/Makefile.am
   trunk/doc/gcrypt.texi
   trunk/m4/
   trunk/m4/ChangeLog
   trunk/m4/noexecstack.m4
   trunk/src/ChangeLog
   trunk/src/Makefile.am
   trunk/src/ath.c
   trunk/src/ath.h
   trunk/src/gcrypt.h.in
   trunk/src/libgcrypt-config.in
   trunk/src/libgcrypt.def
   trunk/src/missing-string.c
   trunk/src/versioninfo.rc.in
   trunk/tests/ChangeLog
   trunk/tests/Makefile.am
   trunk/tests/pkbench.c
   trunk/tests/tsexp.c
Log:
Tweaks for W32



Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
   + Makefile.in
Makefile
aclocal.m4
autom4te.cache
config.h.in
config.h
config.log
config.status
configure
libtool
stamp-h1


Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,3 +1,12 @@
+2007-02-22  Werner Koch  <wk at g10code.com>
+
+	* 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/
+
 2007-02-20  Werner Koch  <wk at g10code.com>
 
 	* configure.ac: Bump LT version to C14/A3/R0 in preparation for a

Modified: trunk/Makefile.am
===================================================================
--- trunk/Makefile.am	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/Makefile.am	2007-02-22 16:37:12 UTC (rev 1214)
@@ -20,7 +20,7 @@
 ACLOCAL_AMFLAGS = -I m4
 AUTOMAKE_OPTIONS = dist-bzip2
 
-DIST_SUBDIRS = m4 mpi cipher src doc tests w32-dll
+DIST_SUBDIRS = m4 mpi cipher src doc tests
 SUBDIRS = mpi cipher src doc tests
 EXTRA_DIST = BUGS autogen.sh README.apichanges README.SVN
 DISTCLEANFILES = 

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/NEWS	2007-02-22 16:37:12 UTC (rev 1214)
@@ -7,6 +7,8 @@
    general a good idea to spread this macro into the application code
    to make sure that these polls happen often enough.
 
+ * Made the RNG immune against fork without exec.
+
  * Reading and writing the random seed file is now protected by a
    fcntl style file lock on systems that provide this function.
 
@@ -25,29 +27,42 @@
  * The new function gcry_md_debug should be used instead of the
    gcry_md_start_debug and gcry_md_stop_debug macros.
 
+ * New configure option --enable-random-daemon to support a system
+   wide random daemon.  The daemon code is experimental and not yet
+   very well working.  It will eventually allow to keep a global
+   random pool for the sake of short living processes.
+
+ * Non executable stack support is now used by default on systems
+   supporting it.
+
+ * Support for Microsoft Windows OSes.
+
+ * Minor changes to some function declarations.  Buffer arguments are
+   now typed as void pointer.  This should not affect any compilation.
+   Fixed two bugs in return values and clarified documentation.
+
  * Interface changes relative to the 1.2.0 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  gcry_fast_random_poll	 NEW
+ gcry_md_debug           NEW
  GCRYCTL_FAKED_RANDOM_P  NEW 
- gcry_pk_algo_name       CHANGED (minor change in respect to return value)
- gcry_cipher_algo_name   CHANGED (minor change in respect to return value)
  GCRY_MD_SHA224          NEW
  GCRY_PK_USAGE_CERT      NEW
  GCRY_PK_USAGE_AUTH      NEW
  GCRY_PK_USAGE_UNKN      NEW
+ GCR_CIPHER_SEED         NEW
  gcry_mpi_scan           CHANGED: Argument BUFFER is now void*.
- GCR_CIPHER_SEED         NEW
- gcry_pk_spec_t          CHANGED (minor change, bug fix)
- gcry_md_write_t         CHANGED (minor change, bug fix)
- gcry_md_debug           NEW
- gcry_cipher_encrypt     CHANGED (minor change)
- gcry_cipher_decrypt     CHANGED (minor change)
- gcry_randomize          CHANGED (minor change)
- gcry_cipher_register    CHANGED (minor change)
-
- FIXME: Please add API changes immediatley so that we don't
-        forget about them.
-
+ gcry_pk_algo_name       CHANGED: Returns "?" instead of NULL.
+ gcry_cipher_algo_name   CHANGED: Returns "?" instead of "".
+ gcry_pk_spec_t          CHANGED: Element ALIASES is now const ptr.
+ gcry_md_write_t         CHANGED: Argument BUF is now a const void*.
+ gcry_md_ctl             CHANGED: Argument BUFFER is now void*.
+ gcry_cipher_encrypt     CHANGED: Arguments IN and OUT are now void*.
+ gcry_cipher_decrypt     CHANGED: Arguments IN and OUT are now void*.
+ gcry_sexp_sprint        CHANGED: Argument BUFFER is now void*.
+ gcry_create_nonce       CHANGED: Argument BUFFER is now void*.
+ gcry_randomize          CHANGED: Argument BUFFER is now void*.
+ gcry_cipher_register    CHANGED: Argument ALGORITHM_ID is now int*.
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 

Modified: trunk/README
===================================================================
--- trunk/README	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/README	2007-02-22 16:37:12 UTC (rev 1214)
@@ -119,7 +119,12 @@
                      try to use the OS provided macros at compile
                      time.  This is helpful to create OS X fat binaries.
 
+     --enable-random-daemon
+                     Include support for a global random damon and
+                     build the daemon.  The daemon itself is in an
+                     experimental state.
 
+
     Contact
     -------
 

Modified: trunk/autogen.sh
===================================================================
--- trunk/autogen.sh	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/autogen.sh	2007-02-22 16:37:12 UTC (rev 1214)
@@ -77,8 +77,7 @@
 
     ./configure --enable-maintainer-mode  --prefix=${w32root}  \
             --host=${host} --build=${build} \
-            --with-gpg-error-prefix=${w32root}  \
-            --disable-shared    
+            --with-gpg-error-prefix=${w32root} 
 
     exit $?
 fi

Modified: trunk/cipher/ChangeLog
===================================================================
--- trunk/cipher/ChangeLog	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,3 +1,14 @@
+2007-02-22  Werner Koch  <wk at g10code.com>
+
+	* rndw32.c (_gcry_rndw32_gather_random_fast): Make it return void.
+
+	* cipher.c (gcry_cipher_algo_name): Simplified.
+
+	* random.c: Use the daemon only if compiled with USE_RANDOM_DAEMON. 
+
+	* Makefile.am (libcipher_la_SOURCES): Build random-daemon support
+	only if requested.
+
 2007-02-21  Werner Koch  <wk at g10code.com>
 
 	* random.c (rndpool, keypool): Make unsigned.

Modified: trunk/cipher/Makefile.am
===================================================================
--- trunk/cipher/Makefile.am	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/Makefile.am	2007-02-22 16:37:12 UTC (rev 1214)
@@ -40,10 +40,15 @@
 cipher.c pubkey.c ac.c md.c \
 bithelp.h  \
 primegen.c  \
-random.c random-daemon.c random.h \
+random.c random.h \
 rand-internal.h \
 rmd.h
 
+if USE_RANDOM_DAEMON
+libcipher_la_SOURCES += random-daemon.c 
+endif USE_RANDOM_DAEMON
+
+
 EXTRA_libcipher_la_SOURCES = \
 arcfour.c \
 blowfish.c \

Modified: trunk/cipher/cipher.c
===================================================================
--- trunk/cipher/cipher.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/cipher.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -431,8 +431,7 @@
 const char *
 gcry_cipher_algo_name (int algorithm)
 {
-  const char *s = cipher_algo_to_string (algorithm);
-  return s ? s : "";
+  return cipher_algo_to_string (algorithm);
 }
 
 

Modified: trunk/cipher/rand-internal.h
===================================================================
--- trunk/cipher/rand-internal.h	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/rand-internal.h	2007-02-22 16:37:12 UTC (rev 1214)
@@ -33,8 +33,8 @@
 int _gcry_rndegd_connect_socket (int nofail);
 int _gcry_rndw32_gather_random (void (*add) (const void *, size_t, int),
                                 int requester, size_t length, int level);
-int _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, int),
-                                     int requester );
+void _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, int),
+                                      int requester );
 
 
 

Modified: trunk/cipher/random.c
===================================================================
--- trunk/cipher/random.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/random.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -94,7 +94,7 @@
 
 
 static int is_initialized;
-static int allow_daemon; /* If true, try to use the daemon first. */
+
 #define MASK_LEVEL(a) do { (a) &= 3; } while(0)
 static unsigned char *rndpool;	/* Allocated size is POOLSIZE+BLOCKLEN.  */
 static unsigned char *keypool;	/* Allocated size is POOLSIZE+BLOCKLEN.  */
@@ -105,9 +105,13 @@
 static int just_mixed;
 static int did_initial_extra_seeding;
 static char *seed_file_name;
-static char *daemon_socket_name;
 static int allow_seed_file_update;
 
+#ifdef USE_RANDOM_DAEMON
+static int allow_daemon;         /* If true, try to use the daemon first. */
+static char *daemon_socket_name; /* User supplied name of the socket.  */
+#endif /*USE_RANDOM_DAEMON*/
+
 static int secure_alloc;
 static int quick_test;
 static int faked_rng;
@@ -161,7 +165,9 @@
       if (err)
         log_fatal ("failed to create the nonce buffer lock: %s\n",
                    strerror (err) );
+#ifdef USE_RANDOM_DAEMON
       _gcry_daemon_initialize_basics ();
+#endif /*USE_RANDOM_DAEMON*/
     }
 }
 
@@ -255,10 +261,14 @@
 void
 _gcry_set_random_daemon_socket (const char *socketname)
 {
+#ifdef USE_RANDOM_DAEMON
   if (daemon_socket_name)
     BUG ();
 
   daemon_socket_name = gcry_xstrdup (socketname);
+#else /*!USE_RANDOM_DAEMON*/
+  (void)socketname;
+#endif /*!USE_RANDOM_DAEMON*/
 }
 
 /* With ONOFF set to 1, enable the use of the daemon.  With ONOFF set
@@ -267,6 +277,7 @@
 int
 _gcry_use_random_daemon (int onoff)
 {
+#ifdef USE_RANDOM_DAEMON
   int last;
   
   /* FIXME: This is not really thread safe. */
@@ -275,6 +286,10 @@
     allow_daemon = onoff;
 
   return last;
+#else /*!USE_RANDOM_DAEMON*/
+  (void)onoff;
+  return 0;
+#endif /*!USE_RANDOM_DAEMON*/
 }
 
 
@@ -304,11 +319,13 @@
   /* Make sure the requested level is in range. */
   MASK_LEVEL(level);
 
+#ifdef USE_RANDOM_DAEMON
   if (allow_daemon &&
       (p=_gcry_daemon_get_random_bytes (daemon_socket_name,
                                         nbytes, level,secure)))
     return p; /* The daemon succeeded. */
   allow_daemon = 0; /* Daemon failed - switch off. */
+#endif /*USE_RANDOM_DAEMON*/
 
   /* Lock the pool. */
   err = ath_mutex_lock (&pool_lock);
@@ -420,10 +437,12 @@
   /* Make sure the level is okay. */
   MASK_LEVEL(level);
 
+#ifdef USE_RANDOM_DAEMON
   if (allow_daemon
       && !_gcry_daemon_randomize (daemon_socket_name, buffer, length, level))
     return; /* The daemon succeeded. */
   allow_daemon = 0; /* Daemon failed - switch off. */
+#endif /*USE_RANDOM_DAEMON*/
 
   /* Acquire the pool lock. */
   err = ath_mutex_lock (&pool_lock);
@@ -1241,10 +1260,12 @@
   if (!is_initialized)
     initialize ();
 
+#ifdef USE_RANDOM_DAEMON
   if (allow_daemon
       && !_gcry_daemon_create_nonce (daemon_socket_name, buffer, length))
     return; /* The daemon succeeded. */
   allow_daemon = 0; /* Daemon failed - switch off. */
+#endif /*USE_RANDOM_DAEMON*/
 
   /* Acquire the nonce buffer lock. */
   err = ath_mutex_lock (&nonce_buffer_lock);

Modified: trunk/cipher/random.h
===================================================================
--- trunk/cipher/random.h	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/random.h	2007-02-22 16:37:12 UTC (rev 1214)
@@ -38,6 +38,7 @@
 void _gcry_fast_random_poll( void );
 
 /*-- random-daemon.c (only used from random.c) --*/
+#ifdef USE_RANDOM_DAEMON
 void _gcry_daemon_initialize_basics (void);
 int _gcry_daemon_randomize (const char *socketname,
                             void *buffer, size_t length,
@@ -46,8 +47,8 @@
                                      size_t nbytes, int level, int secure);
 int _gcry_daemon_create_nonce (const char *socketname,
                                void *buffer, size_t length);
+#endif /*USE_RANDOM_DAEMON*/
 
-
 #endif /*G10_RANDOM_H*/
 
 

Modified: trunk/cipher/rndw32.c
===================================================================
--- trunk/cipher/rndw32.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/cipher/rndw32.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -548,7 +548,7 @@
 }
 
 
-int
+void
 _gcry_rndw32_gather_random_fast (void (*add)(const void*, size_t, int),
                                  int requester )
 {
@@ -677,7 +677,5 @@
 	    (*add) (&aword, sizeof (aword), requester );
 	}
     }
-
-    return 0;
 }
 

Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/configure.ac	2007-02-22 16:37:12 UTC (rev 1214)
@@ -48,7 +48,7 @@
 
 NEED_GPG_ERROR_VERSION=1.0
 
-
+BUILD_REVISION=svn_revision
 PACKAGE=$PACKAGE_NAME
 VERSION=$PACKAGE_VERSION
 
@@ -215,7 +215,7 @@
 
 
 
-# A printable OS Name is sometime useful.
+# A printable OS Name is sometimes useful.
 case "${target}" in
     *-*-mingw32*)
         PRINTABLE_OS_NAME="MingW32"
@@ -238,7 +238,7 @@
         ;;
 esac
 
-
+# Figure out the name of the random device
 case "${target}" in
     *-openbsd*)
         # FIXME: Are these the best flags for OpenBSD?
@@ -401,6 +401,21 @@
                    [Define if you don't want the default EGD socket name.
                     For details see cipher/rndegd.c])
 
+# Implementation of the --enable-random-daemon
+AC_MSG_CHECKING([whether the experimental random daemon is requested])
+AC_ARG_ENABLE([random-daemon],
+              AC_HELP_STRING([--enable-random-daemon],
+                             [Build and support the experimental gcryptrnd]),
+              [use_random_daemon=$enableval],
+              [use_random_daemon=no])
+AC_MSG_RESULT($use_random_daemon)
+if test x$use_random_daemon = xyes ; then
+    AC_DEFINE(USE_RANDOM_DAEMON,1,
+              [Define to support the experimental random daemon])
+fi
+AM_CONDITIONAL(USE_RANDOM_DAEMON, test x$use_random_daemon = xyes)
+
+
 # Implementation of --disable-asm.
 AC_MSG_CHECKING([whether assembler modules are requested])
 AC_ARG_ENABLE([asm],
@@ -482,8 +497,9 @@
 if test x$pth_config_prefix != x ; then
    PTH_CONFIG="$pth_config_prefix/bin/pth-config"
 fi
-AC_PATH_PROG(PTH_CONFIG, pth-config, no)
-if test "$PTH_CONFIG" = "no"; then
+if test "$use_random_daemon" = "yes"; then
+  AC_PATH_PROG(PTH_CONFIG, pth-config, no)
+  if test "$PTH_CONFIG" = "no"; then
     AC_MSG_WARN([[
 ***
 *** To build the Libgcrypt's random humber daemon
@@ -492,16 +508,17 @@
 *** On a Debian GNU/Linux system you might want to try 
 ***   apt-get install libpth-dev
 ***]])
- else
-  GNUPG_PTH_VERSION_CHECK([1.3.7])
-  if test $have_pth = yes; then      
-     PTH_CFLAGS=`$PTH_CONFIG --cflags`
-     PTH_LIBS=`$PTH_CONFIG --ldflags`
-     PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
-     AC_DEFINE(USE_GNU_PTH, 1,
-              [Defined if the GNU Portable Thread Library should be used])
-     AC_DEFINE(HAVE_PTH, 1,
-              [Defined if the GNU Pth is available])
+  else
+    GNUPG_PTH_VERSION_CHECK([1.3.7])
+    if test $have_pth = yes; then      
+       PTH_CFLAGS=`$PTH_CONFIG --cflags`
+       PTH_LIBS=`$PTH_CONFIG --ldflags`
+       PTH_LIBS="$PTH_LIBS `$PTH_CONFIG --libs --all`"
+       AC_DEFINE(USE_GNU_PTH, 1,
+                [Defined if the GNU Portable Thread Library should be used])
+       AC_DEFINE(HAVE_PTH, 1,
+                [Defined if the GNU Pth is available])
+    fi
   fi
 fi
 AC_SUBST(PTH_CFLAGS)
@@ -882,6 +899,23 @@
 AC_SUBST(LIBGCRYPT_DIGESTS, $enabled_digests)
 
 
+# Generate extended version information for W32.
+if test "$have_w32_system" = yes; then
+   BUILD_TIMESTAMP=`date --iso-8601=minutes`
+   changequote(,)dnl 
+   BUILD_FILEVERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./;s/\./,/g'`
+   changequote([,])dnl
+   BUILD_FILEVERSION="${BUILD_FILEVERSION}${BUILD_REVISION}"
+fi
+AC_SUBST(BUILD_REVISION)
+AC_SUBST(BUILD_TIMESTAMP)
+AC_SUBST(BUILD_FILEVERSION)
+AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION", 
+                   [Subversion revision used to build this package])
+
+
+
+# And create the files.
 AC_CONFIG_FILES([
 Makefile
 m4/Makefile
@@ -891,8 +925,8 @@
 src/Makefile
 src/gcrypt.h
 src/libgcrypt-config
+src/versioninfo.rc
 tests/Makefile
-w32-dll/Makefile
 ])
 AC_OUTPUT
 

Modified: trunk/doc/Makefile.am
===================================================================
--- trunk/doc/Makefile.am	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/doc/Makefile.am	2007-02-22 16:37:12 UTC (rev 1214)
@@ -23,11 +23,11 @@
 gcrypt_TEXINFOS = lgpl.texi gpl.texi
 
 
-online: gcrypt.html gcrypt.pdf
+online: gcrypt.html gcrypt.pdf gcrypt.info
 	set -e; \
 	echo "Uploading current manuals to www.gnupg.org ..."; \
-        user=werner ; \
+        user=werner ; dir="webspace/manuals/gcrypt-devel/" ; \
 	(cd gcrypt.html && rsync -vr --exclude='.svn' .  \
-	  $${user}@cvs.gnupg.org:webspace/manuals/gcrypt/ ); \
-        rsync -v gcrypt.pdf $${user}@cvs.gnupg.org:webspace/manuals/
+	  $${user}@cvs.gnupg.org:$${dir} ); \
+        rsync -v gcrypt.pdf gcrypt.info $${user}@cvs.gnupg.org:$${dir}
 

Modified: trunk/doc/gcrypt.texi
===================================================================
--- trunk/doc/gcrypt.texi	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/doc/gcrypt.texi	2007-02-22 16:37:12 UTC (rev 1214)
@@ -12,7 +12,7 @@
 (version @value{VERSION}, @value{UPDATED}),
 which is GNU's library of cryptographic building blocks.
 
-Copyright @copyright{} 2000, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
+Copyright @copyright{} 2000, 2002, 2003, 2004, 2006, 2007 Free Software Foundation, Inc.
 
 @quotation
 Permission is granted to copy, distribute and/or modify this document
@@ -46,10 +46,11 @@
 @insertcopying
 @end titlepage
 
-
+ at ifnothtml
 @summarycontents
 @contents
 @page
+ at end ifnothtml
 
 
 @ifnottex
@@ -168,7 +169,13 @@
 
 @end menu
 
+ at ifhtml
+ at page
+ at summarycontents
+ at contents
+ at end ifhtml
 
+
 @c **********************************************************
 @c *******************  Introduction  ***********************
 @c **********************************************************
@@ -1567,8 +1574,8 @@
 
 @code{gcry_cipher_algo_name} returns a string with the name of the
 cipher algorithm @var{algo}.  If the algorithm is not known or another
-error occurred, an empty string is returned.  This function will never
-return @code{NULL}.
+error occurred, the string @code{"?"} is returned.  This function should
+not be used to test for the availability of an algorithm.
 @end deftypefun
 
 @deftypefun int gcry_cipher_map_name (const char *@var{name})
@@ -1956,8 +1963,8 @@
 @deftypefun const char *gcry_md_algo_name (int @var{algo})
 
 Map the digest algorithm id @var{algo} to a string representation of the
-algorithm name.  For unknown algorithms this function returns an
-empty string.  This function should not be used to test for the
+algorithm name.  For unknown algorithms this function returns the
+string @code{"?"}.  This function should not be used to test for the
 availability of an algorithm.
 @end deftypefun
 
@@ -2565,8 +2572,9 @@
 @deftypefun {const char *} gcry_pk_algo_name (int @var{algo})
 
 Map the public key algorithm id @var{algo} to a string representation of
-the algorithm name.  For unknown algorithms this functions returns an
-empty string.
+the algorithm name.  For unknown algorithms this functions returns the
+string @code{"?"}.  This function should not be used to test for the
+availability of an algorithm.
 @end deftypefun
 
 @deftypefun int gcry_pk_map_name (const char *@var{name})
@@ -3025,7 +3033,7 @@
 @var{algorithm} must be a valid algorithm ID, see @xref{Available
 algorithms}, for a list of supported algorithms and the according
 constants.  Besides using the listed constants directly, the functions
- at code{gcry_ac_name_to_id} may be used to convert the textual name of
+ at code{gcry_pk_name_to_id} may be used to convert the textual name of
 an algorithm into the according numeric ID.
 @end deftypefun
 
@@ -3307,14 +3315,17 @@
 @node Handle-independent functions
 @section Handle-independent functions
 
+These two functions are deprecated; do not use them for new code.
+
 @deftypefun gcry_error_t gcry_ac_id_to_name (gcry_ac_id_t @var{algorithm}, const char **@var{name})
 Stores the textual representation of the algorithm whose id is given
-in @var{algorithm} in @var{name}.
+in @var{algorithm} in @var{name}.  Deprecated; use @code{gcry_pk_algo_name}.
 @end deftypefun
 
 @deftypefun gcry_error_t gcry_ac_name_to_id (const char *@var{name}, gcry_ac_id_t *@var{algorithm})
 Stores the numeric ID of the algorithm whose textual representation is
-contained in @var{name} in @var{algorithm}.
+contained in @var{name} in @var{algorithm}. Deprecated; use
+ at code{gcry_pk_map_name}.
 @end deftypefun
 
 @c **********************************************************


Property changes on: trunk/m4
___________________________________________________________________
Name: svn:ignore
   + Makefile.in
Makefile


Modified: trunk/m4/ChangeLog
===================================================================
--- trunk/m4/ChangeLog	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/m4/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,3 +1,7 @@
+2007-02-22  Werner Koch  <wk at g10code.com>
+
+	* noexecstack.m4: Change default to enable it.
+
 2007-02-20  Werner Koch  <wk at g10code.com>
 
 	* Makefile.am: New.

Modified: trunk/m4/noexecstack.m4
===================================================================
--- trunk/m4/noexecstack.m4	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/m4/noexecstack.m4	2007-02-22 16:37:12 UTC (rev 1214)
@@ -25,9 +25,9 @@
 
 AC_MSG_CHECKING([whether non excutable stack support is requested])
 AC_ARG_ENABLE(noexecstack,
-              AC_HELP_STRING([--enable-noexecstack],
-                             [enable non executable stack support (gcc only)]),
-              noexecstack_support=$enableval, noexecstack_support=no)
+              AC_HELP_STRING([--disable-noexecstack],
+                             [disable non executable stack support]),
+              noexecstack_support=$enableval, noexecstack_support=yes)
 AC_MSG_RESULT($noexecstack_support)
 
 AC_CACHE_CHECK([whether assembler supports --noexecstack option],

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,5 +1,29 @@
+2007-02-22  Werner Koch  <wk at g10code.com>
+
+	* gcrypt.h.in (gcry_ac_id_to_name, gcry_ac_name_to_id): Mark as
+	deprecated.
+
+	* libgcrypt.def (gcry_fast_random_poll): Removed - it is a macro.
+	(gcry_cipher_register, gcry_cipher_unregister): New.
+	(gcry_md_register, gcry_md_unregister): New.
+	(gcry_pk_register, gcry_pk_unregister): New.
+	(gcry_ac_data_from_sexp, gcry_ac_data_to_sexp): New.
+	(gcry_ac_io_init, gcry_ac_io_init_va): New.
+	(gcry_ac_data_encrypt_scheme, gcry_ac_data_decrypt_scheme): New.
+	(gcry_ac_data_sign_scheme, gcry_ac_data_verify_scheme): New.
+
+	* missing-string.c: Include stdio.h for the vsprintf prototype.
+
+	* ath.h (struct ath_ops) [_WIN32]: Use int instead of socklen_t.
+
 2007-02-21  Werner Koch  <wk at g10code.com>
 
+	* libgcrypt.def (gcry_create_nonce, gcry_fast_random_poll)
+	(gcry_md_debug): New.
+
+	* libgcrypt-config.in: Remove duplicates from --cflags and --libs.
+	Print a error for option --thread.
+
 	* gcrypt.h.in (gcry_sexp_sprint): Change BUFFER from char* to void*.
 	(gcry_md_ctl): Change BUFFER from unsigned char* to void*.
 	(gcry_md_debug): New.

Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/Makefile.am	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,4 +1,6 @@
-# Copyright (C) 1998,1999,2000,2001,2002,2003,2004,2005,2006 Free Software Foundation, Inc.
+# Makefile.am - for gcrypt/src
+# Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
+#               2006, 2007  Free Software Foundation, Inc.
 #
 # This file is part of Libgcrypt.
 #
@@ -26,8 +28,10 @@
 include_HEADERS = gcrypt.h gcrypt-module.h
 
 lib_LTLIBRARIES = libgcrypt.la
+if USE_RANDOM_DAEMON
 sbin_PROGRAMS = gcryptrnd
 bin_PROGRAMS = getrandom
+endif USE_RANDOM_DAEMON
 
 if HAVE_LD_VERSION_SCRIPT
   libgcrypt_version_script_cmd = -Wl,--version-script=$(srcdir)/libgcrypt.vers
@@ -65,7 +69,8 @@
 
 gcrypt_deps = $(gcrypt_res) libgcrypt.def
 
-else
+else !HAVE_W32_SYSTEM
+
 gcrypt_res =
 gcrypt_res_ldflag =
 no_undefined =
@@ -74,8 +79,10 @@
 uninstall-def-file:
 
 gcrypt_deps =
-endif
 
+endif !HAVE_W32_SYSTEM
+
+
 libgcrypt_la_LDFLAGS = $(gcrypt_res_ldflag) $(no_undefined) $(export_symbols) \
 	$(libgcrypt_version_script_cmd) -version-info \
 	@LIBGCRYPT_LT_CURRENT@:@LIBGCRYPT_LT_REVISION@:@LIBGCRYPT_LT_AGE@
@@ -84,12 +91,16 @@
 libgcrypt_la_LIBADD = ../cipher/libcipher.la ../mpi/libmpi.la \
 	@LTLIBOBJS@ @GPG_ERROR_LIBS@
 
+
+if USE_RANDOM_DAEMON
 gcryptrnd_SOURCES = gcryptrnd.c
 gcryptrnd_CFLAGS = $(GPG_ERROR_CFLAGS) $(PTH_CFLAGS)
 gcryptrnd_LDADD = ../src/libgcrypt.la $(PTH_LIBS)
 
 getrandom_SOURCES = getrandom.c
+endif USE_RANDOM_DAEMON
 
+
 install-data-local: install-def-file
 
 uninstall-local: uninstall-def-file

Modified: trunk/src/ath.c
===================================================================
--- trunk/src/ath.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/ath.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -285,7 +285,7 @@
 
 int
 #ifdef _WIN32
-ath_connect (int s, void *addr, socklen_t length)
+ath_connect (int s, void *addr, int length)
 #else
 ath_connect (int s, struct sockaddr *addr, socklen_t length)
 #endif

Modified: trunk/src/ath.h
===================================================================
--- trunk/src/ath.h	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/ath.h	2007-02-22 16:37:12 UTC (rev 1214)
@@ -80,7 +80,7 @@
 		     struct timeval *timeout);
   ssize_t (*waitpid) (pid_t pid, int *status, int options);
   int (*accept) (int s, void  *addr, int *length_ptr);
-  int (*connect) (int s, void *addr, socklen_t length);
+  int (*connect) (int s, void *addr, int length);
   int (*sendmsg) (int s, const void *msg, int flags);
   int (*recvmsg) (int s, void *msg, int flags);
 #else

Modified: trunk/src/gcrypt.h.in
===================================================================
--- trunk/src/gcrypt.h.in	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/gcrypt.h.in	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1092,8 +1092,8 @@
                                size_t *nbytes);
 
 /* Map the digest algorithm id ALGO to a string representation of the
-   algorithm name.  For unknown algorithms this functions returns an
-   empty string. */
+   algorithm name.  For unknown algorithms this functions returns
+   "?". */
 const char *gcry_md_algo_name (int algo) _GCRY_GCC_ATTR_PURE;
 
 /* Map the algorithm NAME to a digest algorithm Id.  Return 0 if
@@ -1515,14 +1515,16 @@
 					 gcry_ac_io_t *io_signature);
 
 /* Store the textual representation of the algorithm whose id is given
-   in ALGORITHM in NAME.  */
+   in ALGORITHM in NAME.  This function is deprecated; use
+   gcry_pk_algo_name. */
 gcry_error_t gcry_ac_id_to_name (gcry_ac_id_t algorithm,
-                                const char **name);
-
+                                 const char **name) _GCRY_GCC_ATTR_DEPRECATED;
 /* Store the numeric ID of the algorithm whose textual representation
-   is contained in NAME in ALGORITHM.  */
+   is contained in NAME in ALGORITHM.  This function is deprecated;
+   use gcry_pk_map_name. */
 gcry_error_t gcry_ac_name_to_id (const char *name,
-                                gcry_ac_id_t *algorithm);
+                                 gcry_ac_id_t *algorithm
+                                 ) _GCRY_GCC_ATTR_DEPRECATED;;
 
 
 

Modified: trunk/src/libgcrypt-config.in
===================================================================
--- trunk/src/libgcrypt-config.in	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/libgcrypt-config.in	2007-02-22 16:37:12 UTC (rev 1214)
@@ -8,6 +8,8 @@
 # This file is distributed in the hope that it will be useful, but
 # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+#
+# File: @configure_input@
 
 # General.
 prefix="@prefix@"
@@ -75,7 +77,7 @@
     case $1 in
 	--thread=*)
 	    echo "$0: --thread option obsolete: use the thread callback interface" 1>&2
-	    # exit 1  <-- enable this for 1.2.0.
+	    exit 1
 	    ;;
         --prefix=*)
             # For compatibility reasons with old M4 macros, we ignore
@@ -130,7 +132,13 @@
     # Set up `cflags_final'.
     cflags_final="$cflags_final $gpg_error_cflags"
 
-    echo "$includes $cflags_final"
+    tmp=""
+    for i in $includes $cflags_final; do
+       if echo "$tmp" | fgrep -v -- "$i" >/dev/null; then
+           tmp="$tmp $i"
+       fi
+    done
+    echo $tmp
 fi
 
 if test "$echo_libs" = "yes"; then
@@ -145,7 +153,13 @@
     # Set up `libs_final'.
     libs_final="$libs_final $gpg_error_libs"
 
-    echo "$libdirs $libs_final"
+    tmp=""
+    for i in $libdirs $libs_final; do
+       if echo "$tmp" | fgrep -v -- "$i" >/dev/null; then
+           tmp="$tmp $i"
+       fi
+    done
+    echo $tmp
 fi
 
 if test "$echo_version" = "yes"; then

Modified: trunk/src/libgcrypt.def
===================================================================
--- trunk/src/libgcrypt.def	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/libgcrypt.def	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,5 +1,5 @@
 ;; libgcrypt.defs -  Exported symbols for W32
-;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Copyright (C) 2003, 2007 Free Software Foundation, Inc.
 ;; 
 ;; This file is part of Libgcrypt.
 ;;
@@ -204,3 +204,23 @@
       gcry_prime_group_generator  @168
       gcry_prime_release_factors  @169
       gcry_prime_check  @170
+
+      gcry_create_nonce  @171
+
+      gcry_md_debug  @172
+
+      gcry_cipher_register  @173
+      gcry_cipher_unregister @174
+      gcry_md_register  @175
+      gcry_md_unregister @176
+      gcry_pk_register  @177
+      gcry_pk_unregister @178
+       
+      gcry_ac_data_from_sexp  @179
+      gcry_ac_data_to_sexp  @180
+      gcry_ac_io_init  @181
+      gcry_ac_io_init_va  @182
+      gcry_ac_data_encrypt_scheme  @183
+      gcry_ac_data_decrypt_scheme  @184
+      gcry_ac_data_sign_scheme  @185
+      gcry_ac_data_verify_scheme  @186

Modified: trunk/src/missing-string.c
===================================================================
--- trunk/src/missing-string.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/missing-string.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -20,6 +20,7 @@
  */
 
 #include <config.h>
+#include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <ctype.h>

Modified: trunk/src/versioninfo.rc.in
===================================================================
--- trunk/src/versioninfo.rc.in	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/src/versioninfo.rc.in	2007-02-22 16:37:12 UTC (rev 1214)
@@ -34,12 +34,13 @@
     BEGIN
         BLOCK "040904b0"
         BEGIN
-            VALUE "Comments", "Provided under the terms of the GNU Lesser General Public License.\0"
+            /* Note that the Windows versioin falls under the GPL. */
+            VALUE "Comments", "Provided under the terms of the GNU General Public License.\0"
             VALUE "CompanyName", "g10 Code GmbH\0"
-            VALUE "FileDescription", "libgcrypt - The GNU crypto library\0"
+            VALUE "FileDescription", "Libgcrypt - The GNU Crypto Library\0"
             VALUE "FileVersion", "@LIBGCRYPT_LT_CURRENT at .@LIBGCRYPT_LT_AGE at .@LIBGCRYPT_LT_REVISION at .@BUILD_REVISION@\0"
             VALUE "InternalName", "libgcrypt\0"
-            VALUE "LegalCopyright", "Copyright © 2005, 2006 g10 Code GmbH\0"
+            VALUE "LegalCopyright", "Copyright © 2007 Free Software Foundation, Inc.\0"
             VALUE "LegalTrademarks", "\0"
             VALUE "OriginalFilename", "libgcrypt.dll\0"
             VALUE "PrivateBuild", "\0"

Modified: trunk/tests/ChangeLog
===================================================================
--- trunk/tests/ChangeLog	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/tests/ChangeLog	2007-02-22 16:37:12 UTC (rev 1214)
@@ -1,3 +1,8 @@
+2007-02-22  Werner Koch  <wk at g10code.com>
+
+	* Makefile.am (TESTS) [W32]: Removed pkbench for now.
+	* pkbench.c (benchmark): Fixed for W32.
+
 2007-02-21  Werner Koch  <wk at g10code.com>
 
 	* hmac.c (check_one_mac): Make pointer args const.

Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/tests/Makefile.am	2007-02-22 16:37:12 UTC (rev 1214)
@@ -19,8 +19,15 @@
 ## Process this file with automake to produce Makefile.in
 
 TESTS = t-mpi-bit prime register ac ac-schemes ac-data basic \
-        tsexp keygen pubkey benchmark pkbench hmac keygrip
+        tsexp keygen pubkey benchmark hmac keygrip
 
+# pkbench uses mmap for no good reason.  Needs to be fixed.  Code for
+# this can be found in libksba/tests.
+if !HAVE_W32_SYSTEM
+TESTS += pkbench 
+endif
+
+
 # Need to include ../src in addition to top_srcdir because gcrypt.h is
 # a built header.
 AM_CPPFLAGS = -I../src -I$(top_srcdir)/src

Modified: trunk/tests/pkbench.c
===================================================================
--- trunk/tests/pkbench.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/tests/pkbench.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -27,7 +27,9 @@
 #include <stdlib.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
+#ifndef HAVE_W32_SYSTEM
 #include <sys/times.h>
+#endif HAVE_W32_SYSTEM
 #include <unistd.h>
 #include <fcntl.h>
 #include <time.h>
@@ -52,16 +54,24 @@
   struct tms timer;
   int ret = 0;
 
+#ifdef HAVE_W32_SYSTEM
+  timer_start = clock ();
+#else
   times (&timer);
   timer_start = timer.tms_utime;
+#endif
   for (i = 0; i < loop; i++)
     {
       ret = (*worker) (context, (i + 1) == loop);
       if (! ret)
 	break;
     }
+#ifdef HAVE_W32_SYSTEM
+  timer_stop = clock ();
+#else
   times (&timer);
   timer_stop = timer.tms_utime;
+#endif
 
   if (ret)
     printf ("%.0f ms\n",

Modified: trunk/tests/tsexp.c
===================================================================
--- trunk/tests/tsexp.c	2007-02-21 13:26:38 UTC (rev 1213)
+++ trunk/tests/tsexp.c	2007-02-22 16:37:12 UTC (rev 1214)
@@ -248,7 +248,8 @@
   info ("checking canoncial length test function\n");
   for (idx=0; values[idx].text; idx++)
     {
-      n = gcry_sexp_canon_len (values[idx].text, values[idx].textlen, 
+      n = gcry_sexp_canon_len ((const unsigned char*)values[idx].text,
+                               values[idx].textlen, 
                                &erroff, &errcode);
       
       if (n && n == values[idx].expected)




More information about the Gnupg-commits mailing list