diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-11-09 10:55:48 +0100 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-11 12:02:01 +0100 |
commit | 0f68f59dd4517fd462aad6432401167e1086d833 (patch) | |
tree | 9c09d7428cbbea293fec1f204d689dd22e0fdabc | |
parent | 2fee530c86d5e203a311e0857330fa94ab18c6e9 (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)
-rw-r--r-- | crypto/dh/dh_gen.c | 4 |
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; |