summaryrefslogtreecommitdiff
path: root/src/util/crypto_random.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/crypto_random.c')
-rw-r--r--src/util/crypto_random.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/crypto_random.c b/src/util/crypto_random.c
index 71eaab87a..58cab082e 100644
--- a/src/util/crypto_random.c
+++ b/src/util/crypto_random.c
@@ -80,7 +80,7 @@ glibc_weak_rand32 ()
80static double 80static double
81get_weak_random () 81get_weak_random ()
82{ 82{
83 return ((double) RANDOM () / RAND_MAX); 83 return ((double) random () / RAND_MAX);
84} 84}
85 85
86 86
@@ -93,7 +93,7 @@ get_weak_random ()
93void 93void
94GNUNET_CRYPTO_seed_weak_random (int32_t seed) 94GNUNET_CRYPTO_seed_weak_random (int32_t seed)
95{ 95{
96 SRANDOM (seed); 96 srandom (seed);
97} 97}
98 98
99 99
@@ -324,7 +324,7 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
324 324
325 if (! gcry_check_version (NEED_LIBGCRYPT_VERSION)) 325 if (! gcry_check_version (NEED_LIBGCRYPT_VERSION))
326 { 326 {
327 FPRINTF ( 327 fprintf (
328 stderr, 328 stderr,
329 _ ("libgcrypt has not the expected version (version %s is required).\n"), 329 _ ("libgcrypt has not the expected version (version %s is required).\n"),
330 NEED_LIBGCRYPT_VERSION); 330 NEED_LIBGCRYPT_VERSION);
@@ -334,14 +334,14 @@ void __attribute__ ((constructor)) GNUNET_CRYPTO_random_init ()
334 gcry_set_allocation_handler (&w_malloc, &w_malloc, &w_check, &realloc, &free); 334 gcry_set_allocation_handler (&w_malloc, &w_malloc, &w_check, &realloc, &free);
335 /* Disable use of secure memory */ 335 /* Disable use of secure memory */
336 if ((rc = gcry_control (GCRYCTL_DISABLE_SECMEM, 0))) 336 if ((rc = gcry_control (GCRYCTL_DISABLE_SECMEM, 0)))
337 FPRINTF (stderr, 337 fprintf (stderr,
338 "Failed to set libgcrypt option %s: %s\n", 338 "Failed to set libgcrypt option %s: %s\n",
339 "DISABLE_SECMEM", 339 "DISABLE_SECMEM",
340 gcry_strerror (rc)); 340 gcry_strerror (rc));
341 /* Otherwise gnunet-ecc takes forever to complete, besides 341 /* Otherwise gnunet-ecc takes forever to complete, besides
342 we are fine with "just" using GCRY_STRONG_RANDOM */ 342 we are fine with "just" using GCRY_STRONG_RANDOM */
343 if ((rc = gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0))) 343 if ((rc = gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0)))
344 FPRINTF (stderr, 344 fprintf (stderr,
345 "Failed to set libgcrypt option %s: %s\n", 345 "Failed to set libgcrypt option %s: %s\n",
346 "ENABLE_QUICK_RANDOM", 346 "ENABLE_QUICK_RANDOM",
347 gcry_strerror (rc)); 347 gcry_strerror (rc));