summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_key.c
diff options
context:
space:
mode:
authortb <>2018-11-06 07:02:33 +0000
committertb <>2018-11-06 07:02:33 +0000
commit63569101089cbba78ffa6d2b7ab83e719262f5f0 (patch)
tree1f596901d57af99b215ca32a39768fc112724428 /src/lib/libcrypto/ec/ec_key.c
parent8920ada6f077f74fa71612e7cab28a0a06089296 (diff)
downloadopenbsd-63569101089cbba78ffa6d2b7ab83e719262f5f0.tar.gz
openbsd-63569101089cbba78ffa6d2b7ab83e719262f5f0.tar.bz2
openbsd-63569101089cbba78ffa6d2b7ab83e719262f5f0.zip
unrevert the use of bn_rand_interval().
ok beck jsing
Diffstat (limited to 'src/lib/libcrypto/ec/ec_key.c')
-rw-r--r--src/lib/libcrypto/ec/ec_key.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/lib/libcrypto/ec/ec_key.c b/src/lib/libcrypto/ec/ec_key.c
index ca49c7676e..6ab4d3c9a4 100644
--- a/src/lib/libcrypto/ec/ec_key.c
+++ b/src/lib/libcrypto/ec/ec_key.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_key.c,v 1.20 2018/11/06 02:14:39 tb Exp $ */ 1/* $OpenBSD: ec_key.c,v 1.21 2018/11/06 07:02:33 tb Exp $ */
2/* 2/*
3 * Written by Nils Larsch for the OpenSSL project. 3 * Written by Nils Larsch for the OpenSSL project.
4 */ 4 */
@@ -65,6 +65,7 @@
65 65
66#include <openssl/opensslconf.h> 66#include <openssl/opensslconf.h>
67 67
68#include "bn_lcl.h"
68#include "ec_lcl.h" 69#include "ec_lcl.h"
69#include <openssl/err.h> 70#include <openssl/err.h>
70 71
@@ -231,10 +232,8 @@ EC_KEY_generate_key(EC_KEY *eckey)
231 if (!EC_GROUP_get_order(eckey->group, order, ctx)) 232 if (!EC_GROUP_get_order(eckey->group, order, ctx))
232 goto err; 233 goto err;
233 234
234 do 235 if (!bn_rand_interval(priv_key, BN_value_one(), order))
235 if (!BN_rand_range(priv_key, order)) 236 goto err;
236 goto err;
237 while (BN_is_zero(priv_key));
238 237
239 if (pub_key == NULL) { 238 if (pub_key == NULL) {
240 if ((pub_key = EC_POINT_new(eckey->group)) == NULL) 239 if ((pub_key = EC_POINT_new(eckey->group)) == NULL)