From 4d14a0160a4c9b56bb435f52958b6af4d767c02d Mon Sep 17 00:00:00 2001 From: tb <> Date: Thu, 13 Feb 2025 11:18:00 +0000 Subject: 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 --- src/lib/libcrypto/dsa/dsa_gen.c | 7 ++----- 1 file 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 @@ -/* $OpenBSD: dsa_gen.c,v 1.33 2024/12/05 19:34:46 tb Exp $ */ +/* $OpenBSD: dsa_gen.c,v 1.34 2025/02/13 11:18:00 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -146,9 +146,6 @@ dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, const EVP_MD *evpmd, else if (seed_len != 0) goto err; - if ((mont = BN_MONT_CTX_new()) == NULL) - goto err; - if ((ctx = BN_CTX_new()) == NULL) goto err; @@ -316,7 +313,7 @@ end: if (!BN_set_word(test, h)) goto err; - if (!BN_MONT_CTX_set(mont, p, ctx)) + if ((mont = BN_MONT_CTX_create(p, ctx)) == NULL) goto err; for (;;) { -- cgit v1.2.3-55-g6feb