diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2011-11-06 13:08:41 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2011-11-06 13:08:41 +0000 |
commit | 85a1a836a2b865cb0ff8ee15647e5c5a8c7e464f (patch) | |
tree | dfae2a8f4d996c4f206a8e1bc7fc94043fdc69d3 /fips | |
parent | a98b8ce652ba1a5b174560fe0c5451376b287092 (diff) | |
download | openssl-85a1a836a2b865cb0ff8ee15647e5c5a8c7e464f.zip openssl-85a1a836a2b865cb0ff8ee15647e5c5a8c7e464f.tar.gz openssl-85a1a836a2b865cb0ff8ee15647e5c5a8c7e464f.tar.bz2 |
check for unset entropy and nonce callbacks
Diffstat (limited to 'fips')
-rw-r--r-- | fips/rand/fips_drbg_lib.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fips/rand/fips_drbg_lib.c b/fips/rand/fips_drbg_lib.c index e0e1d75..ee162d0 100644 --- a/fips/rand/fips_drbg_lib.c +++ b/fips/rand/fips_drbg_lib.c @@ -154,6 +154,8 @@ static size_t fips_get_entropy(DRBG_CTX *dctx, unsigned char **pout, { unsigned char *tout, *p; size_t bl = dctx->entropy_blocklen, rv; + if (!dctx->get_entropy) + return 0; if (dctx->xflags & DRBG_FLAG_TEST || !bl) return dctx->get_entropy(dctx, pout, entropy, min_len, max_len); rv = dctx->get_entropy(dctx, &tout, entropy + bl, @@ -241,7 +243,7 @@ int FIPS_drbg_instantiate(DRBG_CTX *dctx, goto end; } - if (dctx->max_nonce > 0) + if (dctx->max_nonce > 0 && dctx->get_nonce) { noncelen = dctx->get_nonce(dctx, &nonce, dctx->strength / 2, |