PR: 2786
Reported by: Tomas Mraz <tmraz@redhat.com> Treat a NULL value passed to drbg_free_entropy callback as non-op. This can happen if the call to fips_get_entropy fails.
This commit is contained in:
parent
0720bf7df1
commit
7a217076d9
@ -210,8 +210,11 @@ static size_t drbg_get_entropy(DRBG_CTX *ctx, unsigned char **pout,
|
|||||||
|
|
||||||
static void drbg_free_entropy(DRBG_CTX *ctx, unsigned char *out, size_t olen)
|
static void drbg_free_entropy(DRBG_CTX *ctx, unsigned char *out, size_t olen)
|
||||||
{
|
{
|
||||||
OPENSSL_cleanse(out, olen);
|
if (out)
|
||||||
OPENSSL_free(out);
|
{
|
||||||
|
OPENSSL_cleanse(out, olen);
|
||||||
|
OPENSSL_free(out);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set "additional input" when generating random data. This uses the
|
/* Set "additional input" when generating random data. This uses the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user