Check reseed interval before generating output.
authorDr. Stephen Henson <steve@openssl.org>
Mon, 5 Sep 2011 15:45:13 +0000 (15:45 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Mon, 5 Sep 2011 15:45:13 +0000 (15:45 +0000)
fips/rand/fips_drbg_lib.c

index f5f365b..a0bb9ed 100644 (file)
@@ -373,6 +373,9 @@ int FIPS_drbg_generate(DRBG_CTX *dctx, unsigned char *out, size_t outlen,
                goto end;
                }
 
+       if (dctx->reseed_counter >= dctx->reseed_interval)
+               dctx->status = DRBG_STATUS_RESEED;
+
        if (dctx->status == DRBG_STATUS_RESEED || prediction_resistance)
                {
                if (!FIPS_drbg_reseed(dctx, adin, adinlen))