Avoid multiple lock using FIPS DRBG.
Don't use multiple locks when SP800-90 DRBG is used outside FIPS mode. PR#3176 Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
#ifdef OPENSSL_FIPS
|
||||
#include <openssl/fips.h>
|
||||
#include <openssl/fips_rand.h>
|
||||
#include "rand_lcl.h"
|
||||
#endif
|
||||
|
||||
#ifndef OPENSSL_NO_ENGINE
|
||||
@@ -199,7 +200,7 @@ static size_t drbg_get_entropy(DRBG_CTX *ctx, unsigned char **pout,
|
||||
*pout = OPENSSL_malloc(min_len);
|
||||
if (!*pout)
|
||||
return 0;
|
||||
if (RAND_SSLeay()->bytes(*pout, min_len) <= 0)
|
||||
if (md_rand_bytes_lock(*pout, min_len, 0, 0) <= 0)
|
||||
{
|
||||
OPENSSL_free(*pout);
|
||||
*pout = NULL;
|
||||
|
||||
Reference in New Issue
Block a user