summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2022-11-09 10:55:48 +0100
committerTomas Mraz <tomas@openssl.org>2022-11-11 12:01:39 +0100
commit729295023af4598efa6ce5b4ead0dab73345816c (patch)
tree98012c6f8599cc0e978d92f8bc3928ba5659b9ed /crypto/dh
parentc6fb30f488f6e4fd6f9306c8ce1c5345aa5f15fd (diff)
Use libctx when generating DH parameters
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19635) (cherry picked from commit 990d280da95d3c955b86f38b01f5b95ea88d42bb)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_gen.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/dh/dh_gen.c b/crypto/dh/dh_gen.c
index 66d1f94bc0..aec6b85316 100644
--- a/crypto/dh/dh_gen.c
+++ b/crypto/dh/dh_gen.c
@@ -169,7 +169,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);
@@ -213,7 +213,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;