summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-04-07 22:23:32 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-04-07 22:23:32 +0000
commite0769dcdebc0e3f7a50020ae2cd1b682dcfd3bfa (patch)
tree31a556746bd01ddf5ff6a63f1872c788f676eaed /regress/lib
parent91f2e7d51b92a8d82fd7366ccc4d776d02676d2f (diff)
bn_test: a few early return would leak. goto err instead
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libcrypto/bn/bn_test.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/regress/lib/libcrypto/bn/bn_test.c b/regress/lib/libcrypto/bn/bn_test.c
index 93c719e7ff1..57068a10c1b 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.6 2023/04/07 22:22:10 tb Exp $ */
+/* $OpenBSD: bn_test.c,v 1.7 2023/04/07 22:23:31 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -481,7 +481,7 @@ test_div(BIO *bp, BN_CTX *ctx)
if (BN_div(d, c, a, b, ctx)) {
fprintf(stderr, "Division by zero succeeded!\n");
- return (0);
+ goto err;
}
for (i = 0; i < num0 + num1; i++) {
@@ -893,13 +893,13 @@ test_mont(BIO *bp, BN_CTX *ctx)
CHECK_GOTO(BN_zero(n));
if (BN_MONT_CTX_set(mont, n, ctx)) {
fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n");
- return (0);
+ goto err;
}
CHECK_GOTO(BN_set_word(n, 16));
if (BN_MONT_CTX_set(mont, n, ctx)) {
fprintf(stderr, "BN_MONT_CTX_set succeeded for even modulus!\n");
- return (0);
+ goto err;
}
CHECK_GOTO(BN_bntest_rand(a, 100, 0, 0));
@@ -1031,7 +1031,7 @@ test_mod_mul(BIO *bp, BN_CTX *ctx)
CHECK_GOTO(BN_zero(c));
if (BN_mod_mul(e, a, b, c, ctx)) {
fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n");
- return (0);
+ goto err;
}
for (j = 0; j < 3; j++) {