aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac16
-rw-r--r--src/util/crypto_random.c4
2 files changed, 16 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac
index f575af17f..165e66d44 100644
--- a/configure.ac
+++ b/configure.ac
@@ -221,13 +221,25 @@ fi
221 221
222# libgcrypt 222# libgcrypt
223gcrypt=0 223gcrypt=0
224AM_PATH_LIBGCRYPT(1.2.0, gcrypt=1) 224NEED_LIBGCRYPT_API=1
225NEED_LIBGCRYPT_VERSION=1.4.2
226
227
228AM_PATH_LIBGCRYPT("$NEED_LIBGCRYPT_API:$NEED_LIBGCRYPT_VERSION", gcrypt=1)
225AC_CHECK_DECLS([gcry_mpi_lshift], [], [], [[#include <gcrypt.h>]]) 229AC_CHECK_DECLS([gcry_mpi_lshift], [], [], [[#include <gcrypt.h>]])
226 230
227if test $gcrypt = 0 231if test $gcrypt = 0
228then 232then
229 AC_MSG_ERROR([GNUnet needs libgcrypt]) 233 AC_MSG_ERROR([[
234***
235*** You need libgcrypt to build this program.
236** This library is for example available at
237*** ftp://ftp.gnupg.org/gcrypt/libgcrypt/
238*** (at least version $NEED_LIBGCRYPT_VERSION (API $NEED_LIBGCRYPT_API)
239*** is required.)
240***]])
230fi 241fi
242AC_DEFINE_UNQUOTED([NEED_LIBGCRYPT_VERSION], "$NEED_LIBGCRYPT_VERSION", [required libgcrypt version])
231 243
232# Adam shostack suggests the following for Windows: 244# Adam shostack suggests the following for Windows:
233# -D_FORTIFY_SOURCE=2 -fstack-protector-all 245# -D_FORTIFY_SOURCE=2 -fstack-protector-all
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index 8dce1080c..29b25524d 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -335,12 +335,12 @@ killfind ()
335void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init () 335void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
336{ 336{
337 gcry_control (GCRYCTL_DISABLE_SECMEM, 0); 337 gcry_control (GCRYCTL_DISABLE_SECMEM, 0);
338 if (!gcry_check_version (GCRYPT_VERSION)) 338 if (!gcry_check_version (NEED_LIBGCRYPT_VERSION))
339 { 339 {
340 FPRINTF (stderr, 340 FPRINTF (stderr,
341 _ 341 _
342 ("libgcrypt has not the expected version (version %s is required).\n"), 342 ("libgcrypt has not the expected version (version %s is required).\n"),
343 GCRYPT_VERSION); 343 NEED_LIBGCRYPT_VERSION);
344 GNUNET_abort (); 344 GNUNET_abort ();
345 } 345 }
346#ifdef GCRYCTL_INITIALIZATION_FINISHED 346#ifdef GCRYCTL_INITIALIZATION_FINISHED