check for unset entropy and nonce callbacks
This commit is contained in:
parent
8a794abd9d
commit
79f2c9d1cd
@ -154,6 +154,8 @@ static size_t fips_get_entropy(DRBG_CTX *dctx, unsigned char **pout,
|
|||||||
{
|
{
|
||||||
unsigned char *tout, *p;
|
unsigned char *tout, *p;
|
||||||
size_t bl = dctx->entropy_blocklen, rv;
|
size_t bl = dctx->entropy_blocklen, rv;
|
||||||
|
if (!dctx->get_entropy)
|
||||||
|
return 0;
|
||||||
if (dctx->xflags & DRBG_FLAG_TEST || !bl)
|
if (dctx->xflags & DRBG_FLAG_TEST || !bl)
|
||||||
return dctx->get_entropy(dctx, pout, entropy, min_len, max_len);
|
return dctx->get_entropy(dctx, pout, entropy, min_len, max_len);
|
||||||
rv = dctx->get_entropy(dctx, &tout, entropy + bl,
|
rv = dctx->get_entropy(dctx, &tout, entropy + bl,
|
||||||
@ -241,7 +243,7 @@ int FIPS_drbg_instantiate(DRBG_CTX *dctx,
|
|||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dctx->max_nonce > 0)
|
if (dctx->max_nonce > 0 && dctx->get_nonce)
|
||||||
{
|
{
|
||||||
noncelen = dctx->get_nonce(dctx, &nonce,
|
noncelen = dctx->get_nonce(dctx, &nonce,
|
||||||
dctx->strength / 2,
|
dctx->strength / 2,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user