[openssl] openssl-3.0 update
Dr. Paul Dale
pauli at openssl.org
Wed Sep 22 08:02:12 UTC 2021
The branch openssl-3.0 has been updated
via 7260376b775dc929ef205561e1adb244c0dd87af (commit)
from c9fb4c816b6648eccb31ebe84871d50dbfc87b3a (commit)
- Log -----------------------------------------------------------------
commit 7260376b775dc929ef205561e1adb244c0dd87af
Author: Pauli <pauli at openssl.org>
Date: Tue Sep 21 09:19:35 2021 +1000
rand: don't free an mis-set pointer on error
This is adding robustness to the code. The fix to not mis-set the pointer
is in #16636.
Fixes #16631
Reviewed-by: Tomas Mraz <tomas at openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit at gmail.com>
(Merged from https://github.com/openssl/openssl/pull/16640)
(cherry picked from commit caf569a5b3271c2860732ee44509f3825a179fd5)
-----------------------------------------------------------------------
Summary of changes:
providers/implementations/rands/drbg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/providers/implementations/rands/drbg.c b/providers/implementations/rands/drbg.c
index 81343fbd52..8b899b99b1 100644
--- a/providers/implementations/rands/drbg.c
+++ b/providers/implementations/rands/drbg.c
@@ -459,9 +459,11 @@ int ossl_prov_drbg_instantiate(PROV_DRBG *drbg, unsigned int strength,
if (!drbg->instantiate(drbg, entropy, entropylen, nonce, noncelen,
pers, perslen)) {
+ cleanup_entropy(drbg, entropy, entropylen);
ERR_raise(ERR_LIB_PROV, PROV_R_ERROR_INSTANTIATING_DRBG);
goto end;
}
+ cleanup_entropy(drbg, entropy, entropylen);
drbg->state = EVP_RAND_STATE_READY;
drbg->generate_counter = 1;
@@ -469,8 +471,6 @@ int ossl_prov_drbg_instantiate(PROV_DRBG *drbg, unsigned int strength,
tsan_store(&drbg->reseed_counter, drbg->reseed_next_counter);
end:
- if (entropy != NULL)
- cleanup_entropy(drbg, entropy, entropylen);
if (nonce != NULL)
ossl_prov_cleanup_nonce(drbg->provctx, nonce, noncelen);
if (drbg->state == EVP_RAND_STATE_READY)
More information about the openssl-commits
mailing list