From: Dr. Stephen Henson Date: Sun, 6 Nov 2011 13:08:54 +0000 (+0000) Subject: check for unset entropy and nonce callbacks X-Git-Tag: OpenSSL-fips-2_0-rc2~8 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=79f2c9d1cddd9ac7d68c4e3e39c228f01ac79b7e;p=oweals%2Fopenssl.git check for unset entropy and nonce callbacks --- diff --git a/fips/rand/fips_drbg_lib.c b/fips/rand/fips_drbg_lib.c index e0e1d75091..ee162d05eb 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,