summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/dsa/dsa_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libcrypto/dsa/dsa_key.c')
-rw-r--r--lib/libcrypto/dsa/dsa_key.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libcrypto/dsa/dsa_key.c b/lib/libcrypto/dsa/dsa_key.c
index 520b9809834..7ead1f30cc8 100644
--- a/lib/libcrypto/dsa/dsa_key.c
+++ b/lib/libcrypto/dsa/dsa_key.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_key.c,v 1.25 2018/11/05 23:50:05 tb Exp $ */
+/* $OpenBSD: dsa_key.c,v 1.26 2018/11/05 23:54:27 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -92,10 +92,8 @@ dsa_builtin_keygen(DSA *dsa)
goto err;
}
- do {
- if (!BN_rand_range(priv_key, dsa->q))
- goto err;
- } while (BN_is_zero(priv_key));
+ if (!bn_rand_interval(priv_key, BN_value_one(), dsa->q))
+ goto err;
if (pub_key == NULL) {
if ((pub_key = BN_new()) == NULL)