__drbg_seed(drbg, &seedlist, true);
+ if (drbg->seeded)
+ drbg->reseed_threshold = drbg_max_requests(drbg);
+
mutex_unlock(&drbg->drbg_mutex);
memzero_explicit(entropy, entropylen);
* 9.3.1 step 6 and 9 supplemented by 9.3.2 step c is implemented
* here. The spec is a bit convoluted here, we make it simpler.
*/
- if ((drbg_max_requests(drbg)) < drbg->reseed_ctr)
+ if (drbg->reseed_threshold < drbg->reseed_ctr)
drbg->seeded = false;
if (drbg->pr || !drbg->seeded) {
drbg->jent = crypto_alloc_rng("jitterentropy_rng", 0, 0);
+ /*
+ * Require frequent reseeds until the seed source is fully
+ * initialized.
+ */
+ drbg->reseed_threshold = 50;
+
return err;
}
drbg->core = &drbg_cores[coreref];
drbg->pr = pr;
drbg->seeded = false;
+ drbg->reseed_threshold = drbg_max_requests(drbg);
ret = drbg_alloc_state(drbg);
if (ret)
unsigned char *C;
/* Number of RNG requests since last reseed -- 10.1.1.1 1c) */
size_t reseed_ctr;
+ size_t reseed_threshold;
/* some memory the DRBG can use for its operation */
unsigned char *scratchpad;
void *priv_data; /* Cipher handle */