summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa/dsa_gen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa/dsa_gen.c')
-rw-r--r--src/lib/libcrypto/dsa/dsa_gen.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c
index 9c2b9cfd70..1f91894100 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.26 2022/11/26 16:08:52 tb Exp $ */ 1/* $OpenBSD: dsa_gen.c,v 1.27 2023/01/11 04:39:42 jsing 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 *
@@ -142,11 +142,12 @@ dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, const EVP_MD *evpmd,
142 else if (seed_len != 0) 142 else if (seed_len != 0)
143 goto err; 143 goto err;
144 144
145 if ((mont=BN_MONT_CTX_new()) == NULL) 145 if ((mont = BN_MONT_CTX_new()) == NULL)
146 goto err; 146 goto err;
147 147
148 if ((ctx=BN_CTX_new()) == NULL) 148 if ((ctx = BN_CTX_new()) == NULL)
149 goto err; 149 goto err;
150
150 BN_CTX_start(ctx); 151 BN_CTX_start(ctx);
151 152
152 if ((r0 = BN_CTX_get(ctx)) == NULL) 153 if ((r0 = BN_CTX_get(ctx)) == NULL)
@@ -348,11 +349,10 @@ err:
348 if (seed_out != NULL) 349 if (seed_out != NULL)
349 memcpy(seed_out, seed, qsize); 350 memcpy(seed_out, seed, qsize);
350 } 351 }
351 if (ctx) { 352 BN_CTX_end(ctx);
352 BN_CTX_end(ctx); 353 BN_CTX_free(ctx);
353 BN_CTX_free(ctx);
354 }
355 BN_MONT_CTX_free(mont); 354 BN_MONT_CTX_free(mont);
355
356 return ok; 356 return ok;
357} 357}
358#endif 358#endif