From 990d280da95d3c955b86f38b01f5b95ea88d42bb Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Wed, 9 Nov 2022 10:55:48 +0100 Subject: Use libctx when generating DH parameters Reviewed-by: Dmitry Belyavskiy Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/19635) --- crypto/dh/dh_gen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crypto/dh/dh_gen.c') diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c index 628410c0d3..b73bfb7f3b 100644 --- a/crypto/dh/dh_gen.c +++ b/crypto/dh/dh_gen.c @@ -170,7 +170,7 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator, return 0; } - ctx = BN_CTX_new(); + ctx = BN_CTX_new_ex(ret->libctx); if (ctx == NULL) goto err; BN_CTX_start(ctx); @@ -214,7 +214,7 @@ static int dh_builtin_genparams(DH *ret, int prime_len, int generator, g = generator; } - if (!BN_generate_prime_ex(ret->params.p, prime_len, 1, t1, t2, cb)) + if (!BN_generate_prime_ex2(ret->params.p, prime_len, 1, t1, t2, cb, ctx)) goto err; if (!BN_GENCB_call(cb, 3, 0)) goto err; -- cgit v1.2.1