Release Fixes

1. The RNG internal state could be a memory leak if the seed generate
test fails. If the seed test fails, you have bigger problems.
This commit is contained in:
John Safranek
2019-03-18 14:30:51 -07:00
parent eebf07b67c
commit fb3ca1b53e

View File

@ -772,6 +772,11 @@ static int _InitRng(WC_RNG* rng, byte* nonce, word32 nonceSz,
if (ret == DRBG_SUCCESS) if (ret == DRBG_SUCCESS)
ret = Hash_DRBG_Generate(rng->drbg, NULL, 0); ret = Hash_DRBG_Generate(rng->drbg, NULL, 0);
if (ret != DRBG_SUCCESS) {
XFREE(rng->drbg, rng->heap, DYNAMIC_TYPE_RNG);
rng->drbg = NULL;
}
} }
ForceZero(seed, seedSz); ForceZero(seed, seedSz);