summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/dsa
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/dsa')
-rw-r--r--src/lib/libcrypto/dsa/dsa_gen.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/libcrypto/dsa/dsa_gen.c b/src/lib/libcrypto/dsa/dsa_gen.c
index 296a544c31..dcfa957884 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.17 2014/10/22 13:02:04 jsing Exp $ */ 1/* $OpenBSD: dsa_gen.c,v 1.18 2015/02/09 15:49:22 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 *
@@ -148,14 +148,22 @@ dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, const EVP_MD *evpmd,
148 goto err; 148 goto err;
149 149
150 BN_CTX_start(ctx); 150 BN_CTX_start(ctx);
151 r0 = BN_CTX_get(ctx); 151 if ((r0 = BN_CTX_get(ctx)) == NULL)
152 g = BN_CTX_get(ctx); 152 goto err;
153 W = BN_CTX_get(ctx); 153 if ((g = BN_CTX_get(ctx)) == NULL)
154 q = BN_CTX_get(ctx); 154 goto err;
155 X = BN_CTX_get(ctx); 155 if ((W = BN_CTX_get(ctx)) == NULL)
156 c = BN_CTX_get(ctx); 156 goto err;
157 p = BN_CTX_get(ctx); 157 if ((q = BN_CTX_get(ctx)) == NULL)
158 test = BN_CTX_get(ctx); 158 goto err;
159 if ((X = BN_CTX_get(ctx)) == NULL)
160 goto err;
161 if ((c = BN_CTX_get(ctx)) == NULL)
162 goto err;
163 if ((p = BN_CTX_get(ctx)) == NULL)
164 goto err;
165 if ((test = BN_CTX_get(ctx)) == NULL)
166 goto err;
159 167
160 if (!BN_lshift(test, BN_value_one(), bits - 1)) 168 if (!BN_lshift(test, BN_value_one(), bits - 1))
161 goto err; 169 goto err;