diff options
| author | tb <> | 2025-02-13 11:18:00 +0000 |
|---|---|---|
| committer | tb <> | 2025-02-13 11:18:00 +0000 |
| commit | b873158067d72f18b3026b7f4691a448bf46372b (patch) | |
| tree | c58c36f68ab5c8d5e541d2ba804ecd4f93ae414f /src/lib/libcrypto/dsa/dsa_gen.c | |
| parent | aa1d25c8cda35c34eff58c5d6568560b729ba8bf (diff) | |
| download | openbsd-b873158067d72f18b3026b7f4691a448bf46372b.tar.gz openbsd-b873158067d72f18b3026b7f4691a448bf46372b.tar.bz2 openbsd-b873158067d72f18b3026b7f4691a448bf46372b.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
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_gen.c')
| -rw-r--r-- | src/lib/libcrypto/dsa/dsa_gen.c | 7 |
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 (;;) { |
