[rng] Record validity within DRBG state

Treat an empty (zeroed) DRBG as invalid.  This ensures that a DRBG
that has not yet been instantiated (or that has been uninstantiated)
will refuse to attempt to generate random bits.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-02-20 21:24:30 +00:00
parent a99d5d5aca
commit c2668b61ea
2 changed files with 15 additions and 4 deletions

View File

@@ -39,6 +39,8 @@ struct drbg_state {
struct hmac_drbg_state internal;
/** Reseed required flag */
int reseed_required;
/** State is valid */
int valid;
};
/**