aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/drbg.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2012-02-20 21:24:30 +0000
committerMichael Brown <mcb30@ipxe.org>2012-02-21 12:42:37 +0000
commitc2668b61ea5ac01279929be6be86cc04fd342ab5 (patch)
tree1a7e3434ceda88380366731ecd661423f093444d /src/include/ipxe/drbg.h
parenta99d5d5aca298c0618919d9be33ac5e73cb838e7 (diff)
downloadipxe-c2668b61ea5ac01279929be6be86cc04fd342ab5.tar.gz
[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>
Diffstat (limited to 'src/include/ipxe/drbg.h')
-rw-r--r--src/include/ipxe/drbg.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/include/ipxe/drbg.h b/src/include/ipxe/drbg.h
index a09d136dd..3cf4584ac 100644
--- a/src/include/ipxe/drbg.h
+++ b/src/include/ipxe/drbg.h
@@ -39,6 +39,8 @@ struct drbg_state {
struct hmac_drbg_state internal;
/** Reseed required flag */
int reseed_required;
+ /** State is valid */
+ int valid;
};
/**