Initialize reseed_gen_counter to 1, like it is done in master
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Tue, 30 Oct 2018 22:09:56 +0000 (23:09 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 7 Nov 2018 14:16:19 +0000 (15:16 +0100)
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/7532)

crypto/rand/drbg_lib.c

index d9f01cbba9633ddfbfe47925c1c02acd360746a1..de4f3334828d10063c1ab4dd0129398cef975005 100644 (file)
@@ -359,7 +359,7 @@ int RAND_DRBG_instantiate(RAND_DRBG *drbg,
     }
 
     drbg->state = DRBG_READY;
-    drbg->reseed_gen_counter = 0;
+    drbg->reseed_gen_counter = 1;
     drbg->reseed_time = time(NULL);
     tsan_store(&drbg->reseed_prop_counter, drbg->reseed_next_counter);
 
@@ -451,7 +451,7 @@ int RAND_DRBG_reseed(RAND_DRBG *drbg,
         goto end;
 
     drbg->state = DRBG_READY;
-    drbg->reseed_gen_counter = 0;
+    drbg->reseed_gen_counter = 1;
     drbg->reseed_time = time(NULL);
     tsan_store(&drbg->reseed_prop_counter, drbg->reseed_next_counter);