2016-08-22 11:21:16 +02:00
|
|
|
Index: libgcrypt-1.7.2/random/random.c
|
2014-05-27 20:06:59 +02:00
|
|
|
===================================================================
|
2016-08-22 11:21:16 +02:00
|
|
|
--- libgcrypt-1.7.2.orig/random/random.c
|
|
|
|
+++ libgcrypt-1.7.2/random/random.c
|
|
|
|
@@ -419,6 +419,9 @@ _gcry_create_nonce (void *buffer, size_t
|
2014-05-27 20:06:59 +02:00
|
|
|
size_t n;
|
|
|
|
int err;
|
|
|
|
|
|
|
|
+ /* Make sure we are initialized. */
|
|
|
|
+ _gcry_random_initialize (1);
|
|
|
|
+
|
|
|
|
/* First check whether we shall use the FIPS nonce generator. This
|
|
|
|
is only done in FIPS mode, in all other modes, we use our own
|
|
|
|
nonce generator which is seeded by the RNG actual in use. */
|
2016-08-22 11:21:16 +02:00
|
|
|
@@ -433,9 +436,6 @@ _gcry_create_nonce (void *buffer, size_t
|
2014-05-27 20:06:59 +02:00
|
|
|
FIPS mode (not that this means it is also used if the FIPS RNG
|
|
|
|
has been selected but we are not in fips mode). */
|
|
|
|
|
|
|
|
- /* Make sure we are initialized. */
|
|
|
|
- _gcry_random_initialize (1);
|
|
|
|
-
|
|
|
|
/* Acquire the nonce buffer lock. */
|
2016-08-22 11:21:16 +02:00
|
|
|
err = gpgrt_lock_lock (&nonce_buffer_lock);
|
2014-05-27 20:06:59 +02:00
|
|
|
if (err)
|