summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2025-02-13 11:18:00 +0000
committertb <>2025-02-13 11:18:00 +0000
commit4d14a0160a4c9b56bb435f52958b6af4d767c02d (patch)
treec58c36f68ab5c8d5e541d2ba804ecd4f93ae414f
parentc2cead087866346329b7a6d7cafc043d2bddc9e8 (diff)
downloadopenbsd-4d14a0160a4c9b56bb435f52958b6af4d767c02d.tar.gz
openbsd-4d14a0160a4c9b56bb435f52958b6af4d767c02d.tar.bz2
openbsd-4d14a0160a4c9b56bb435f52958b6af4d767c02d.zip
dsa_gen: convert to BN_MONT_CTX_create()
This can now be a single call before the BN_MONT_CTX is actually used rather than two calls separated by 170 lines. ok jsing
-rw-r--r--src/lib/libcrypto/dsa/dsa_gen.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c
index a79d0f9e20..c8f626cd97 100644
--- a/src/lib/libcrypto/dsa/dsa_gen.c
+++ b/src/lib/libcrypto/dsa/dsa_gen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dsa_gen.c,v 1.33 2024/12/05 19:34:46 tb Exp $ */ 1/* $OpenBSD: dsa_gen.c,v 1.34 2025/02/13 11:18:00 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -146,9 +146,6 @@ dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, const EVP_MD *evpmd,
146 else if (seed_len != 0) 146 else if (seed_len != 0)
147 goto err; 147 goto err;
148 148
149 if ((mont = BN_MONT_CTX_new()) == NULL)
150 goto err;
151
152 if ((ctx = BN_CTX_new()) == NULL) 149 if ((ctx = BN_CTX_new()) == NULL)
153 goto err; 150 goto err;
154 151
@@ -316,7 +313,7 @@ end:
316 313
317 if (!BN_set_word(test, h)) 314 if (!BN_set_word(test, h))
318 goto err; 315 goto err;
319 if (!BN_MONT_CTX_set(mont, p, ctx)) 316 if ((mont = BN_MONT_CTX_create(p, ctx)) == NULL)
320 goto err; 317 goto err;
321 318
322 for (;;) { 319 for (;;) {