aboutsummaryrefslogtreecommitdiff
path: root/crypto/rand/drbg_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/rand/drbg_lib.c')
-rw-r--r--crypto/rand/drbg_lib.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/rand/drbg_lib.c b/crypto/rand/drbg_lib.c
index e3d97d3..a24ec8e 100644
--- a/crypto/rand/drbg_lib.c
+++ b/crypto/rand/drbg_lib.c
@@ -78,6 +78,9 @@ RAND_DRBG *RAND_DRBG_new(int type, unsigned int flags, RAND_DRBG *parent)
goto err;
if (parent != NULL) {
+ if (parent->state == DRBG_UNINITIALISED
+ && RAND_DRBG_instantiate(parent, NULL, 0) == 0)
+ goto err;
if (!RAND_DRBG_set_callbacks(drbg, drbg_entropy_from_parent,
drbg_release_entropy,
NULL, NULL)
@@ -98,6 +101,11 @@ err:
return NULL;
}
+RAND_DRBG *RAND_DRBG_get0_global(void)
+{
+ return &rand_drbg;
+}
+
/*
* Uninstantiate |drbg| and free all memory.
*/