summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-04-07 22:25:10 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-04-07 22:25:10 +0000
commitf4d5b08a12f42306c2dfea64680fe278149115ff (patch)
tree2cf12a3904b15c35caa20e5d86855ddc28503c55 /regress/lib
parente0769dcdebc0e3f7a50020ae2cd1b682dcfd3bfa (diff)
bn_test: use bn_copy() instead of BN_free/BN_dup
This is not only simpler but also required by an upcoming change.
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libcrypto/bn/bn_test.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/regress/lib/libcrypto/bn/bn_test.c b/regress/lib/libcrypto/bn/bn_test.c
index 57068a10c1b..a5fe58f55a4 100644
--- a/regress/lib/libcrypto/bn/bn_test.c
+++ b/regress/lib/libcrypto/bn/bn_test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn_test.c,v 1.7 2023/04/07 22:23:31 tb Exp $ */
+/* $OpenBSD: bn_test.c,v 1.8 2023/04/07 22:25:09 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1410,8 +1410,7 @@ test_mod_exp_mont5(BIO *bp, BN_CTX *ctx)
"0000000000000000000000000000000000000000000000000000000000000000"
"000000000000000000000000000000000000000000FFFFFFFFFFFFFF00000000");
CHECK_GOTO(len);
- BN_free(b);
- CHECK_GOTO(b = BN_dup(a));
+ CHECK_GOTO(bn_copy(b, a));
CHECK_GOTO(BN_MONT_CTX_set(mont, n, ctx));
CHECK_GOTO(BN_mod_mul_montgomery(c, a, a, mont, ctx));
CHECK_GOTO(BN_mod_mul_montgomery(d, a, b, mont, ctx));