From 80ef34bc528ae99a99672f4ad876720f812db7da Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 7 Apr 2023 22:25:09 +0000 Subject: [PATCH] bn_test: use bn_copy() instead of BN_free/BN_dup This is not only simpler but also required by an upcoming change. --- regress/lib/libcrypto/bn/bn_test.c | 5 ++--- 1 file 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)); -- 2.20.1