summaryrefslogtreecommitdiff
path: root/providers
diff options
context:
space:
mode:
authorafshinpir <afshinpir@users.noreply.github.com>2023-03-08 16:42:00 +1300
committerPauli <pauli@openssl.org>2023-03-15 08:30:41 +1100
commit6d45fd47f4849c8dc55b8dd5fa1e1b8a158774a0 (patch)
treec173f1ccacf2c22da03a72cab3a46ddeabb3bee9 /providers
parenta3207163ef3d30658a41a9c9e3750ca4c5b16677 (diff)
downloadopenssl-new-6d45fd47f4849c8dc55b8dd5fa1e1b8a158774a0.tar.gz
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)
Diffstat (limited to 'providers')
-rw-r--r--providers/implementations/rands/drbg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/providers/implementations/rands/drbg.c b/providers/implementations/rands/drbg.c
index 11ba455233..de9b2a5a44 100644
--- a/providers/implementations/rands/drbg.c
+++ b/providers/implementations/rands/drbg.c
@@ -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);
}
}