mirror of
https://github.com/openssl/openssl.git
synced 2024-12-03 05:41:46 +08:00
Segmentation fault in parent rng cleanup
CLA: trivial When `cleanup_entropy()` is called to cleanup parent by calling provided `OSSL_FUNC_rand_clear_seed_fn` method, incorrect random context is passed to the method. So accessing that context creates a segmentation fault. Parent context should be passed rather than DRBG's own context. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20454)
This commit is contained in:
parent
a3207163ef
commit
6d45fd47f4
@ -255,7 +255,7 @@ static void cleanup_entropy(PROV_DRBG *drbg, unsigned char *out, size_t outlen)
|
||||
} else if (drbg->parent_clear_seed != NULL) {
|
||||
if (!ossl_drbg_lock_parent(drbg))
|
||||
return;
|
||||
drbg->parent_clear_seed(drbg, out, outlen);
|
||||
drbg->parent_clear_seed(drbg->parent, out, outlen);
|
||||
ossl_drbg_unlock_parent(drbg);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user