gentleknife / rpms / libgcrypt

Forked from rpms/libgcrypt 4 years ago
Clone

Blame SOURCES/libgcrypt-1.5.3-drbg-init.patch

241384
diff -up libgcrypt-1.5.3/random/drbg.c.drbg-init libgcrypt-1.5.3/random/drbg.c
241384
--- libgcrypt-1.5.3/random/drbg.c.drbg-init	2017-02-28 14:28:55.000000000 +0100
241384
+++ libgcrypt-1.5.3/random/drbg.c	2017-02-28 15:15:54.401291408 +0100
241384
@@ -1820,12 +1820,16 @@ _gcry_drbg_randomize (void *buffer, size
241384
 		      enum gcry_random_level level)
241384
 {
241384
   (void) level;
241384
-  gcry_drbg_lock ();
241384
   if (NULL == gcry_drbg)
241384
     {
241384
-      fips_signal_error ("DRBG is not initialized");
241384
-      goto bailout;
241384
+      _gcry_drbg_init(1);
241384
+      if (NULL == gcry_drbg)
241384
+        {
241384
+          log_fatal ("DRBG is not initialized\n");
241384
+          goto bailout;
241384
+        }
241384
     }
241384
+  gcry_drbg_lock ();
241384
 
241384
   /* As reseeding changes the entire state of the DRBG, including any
241384
    * key, either a re-init or a reseed is sufficient for a fork */