summaryrefslogtreecommitdiff
path: root/src/regress/lib/libcrypto/ec/ec_point_conversion.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libcrypto/ec/ec_point_conversion.c')
-rw-r--r--src/regress/lib/libcrypto/ec/ec_point_conversion.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/regress/lib/libcrypto/ec/ec_point_conversion.c b/src/regress/lib/libcrypto/ec/ec_point_conversion.c
index 5a97f67b94..dca35ced59 100644
--- a/src/regress/lib/libcrypto/ec/ec_point_conversion.c
+++ b/src/regress/lib/libcrypto/ec/ec_point_conversion.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_point_conversion.c,v 1.9 2023/04/15 21:53:38 tb Exp $ */ 1/* $OpenBSD: ec_point_conversion.c,v 1.10 2023/04/17 20:41:02 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2021 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2021 Theo Buehler <tb@openbsd.org>
4 * Copyright (c) 2021 Joel Sing <jsing@openbsd.org> 4 * Copyright (c) 2021 Joel Sing <jsing@openbsd.org>
@@ -177,8 +177,10 @@ test_random_points_on_curve(EC_builtin_curve *curve)
177 for (i = 0; i < N_RANDOM_POINTS; i++) { 177 for (i = 0; i < N_RANDOM_POINTS; i++) {
178 EC_POINT *random_point; 178 EC_POINT *random_point;
179 179
180 if (!bn_rand_interval(random, BN_value_one(), order)) 180 do {
181 errx(1, "bn_rand_interval"); 181 if (!BN_rand_range(random, order))
182 errx(1, "BN_rand_range");
183 } while (BN_is_zero(random));
182 184
183 if ((random_point = EC_POINT_new(group)) == NULL) 185 if ((random_point = EC_POINT_new(group)) == NULL)
184 errx(1, "EC_POINT_new"); 186 errx(1, "EC_POINT_new");