diff options
author | tb <> | 2023-04-25 15:32:33 +0000 |
---|---|---|
committer | tb <> | 2023-04-25 15:32:33 +0000 |
commit | 9b40b47c808aeeff7b02d8274ba6ad21822fb51b (patch) | |
tree | da4abeea9b6fe36d9194dd183c1e53fb6e2cc830 /src | |
parent | 9b04c1f12fcd8569361a003ef3f515bde1d39a0f (diff) | |
download | openbsd-9b40b47c808aeeff7b02d8274ba6ad21822fb51b.tar.gz openbsd-9b40b47c808aeeff7b02d8274ba6ad21822fb51b.tar.bz2 openbsd-9b40b47c808aeeff7b02d8274ba6ad21822fb51b.zip |
bn_test: BN_one() will become void, so stop checking it
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/bn/bn_test.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_test.c b/src/regress/lib/libcrypto/bn/bn_test.c index 37765ef137..463e30dfe1 100644 --- a/src/regress/lib/libcrypto/bn/bn_test.c +++ b/src/regress/lib/libcrypto/bn/bn_test.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bn_test.c,v 1.16 2023/04/17 19:56:39 tb Exp $ */ | 1 | /* $OpenBSD: bn_test.c,v 1.17 2023/04/25 15:32:33 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -417,7 +417,7 @@ test_div(BIO *bp, BN_CTX *ctx) | |||
417 | goto err; | 417 | goto err; |
418 | 418 | ||
419 | CHECK_GOTO(BN_one(a)); | 419 | CHECK_GOTO(BN_one(a)); |
420 | CHECK_GOTO(BN_zero(b)); | 420 | BN_zero(b); |
421 | 421 | ||
422 | if (BN_div(d, c, a, b, ctx)) { | 422 | if (BN_div(d, c, a, b, ctx)) { |
423 | fprintf(stderr, "Division by zero succeeded!\n"); | 423 | fprintf(stderr, "Division by zero succeeded!\n"); |
@@ -815,7 +815,7 @@ test_mont(BIO *bp, BN_CTX *ctx) | |||
815 | if ((mont = BN_MONT_CTX_new()) == NULL) | 815 | if ((mont = BN_MONT_CTX_new()) == NULL) |
816 | goto err; | 816 | goto err; |
817 | 817 | ||
818 | CHECK_GOTO(BN_zero(n)); | 818 | BN_zero(n); |
819 | if (BN_MONT_CTX_set(mont, n, ctx)) { | 819 | if (BN_MONT_CTX_set(mont, n, ctx)) { |
820 | fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); | 820 | fprintf(stderr, "BN_MONT_CTX_set succeeded for zero modulus!\n"); |
821 | goto err; | 821 | goto err; |
@@ -949,7 +949,7 @@ test_mod_mul(BIO *bp, BN_CTX *ctx) | |||
949 | 949 | ||
950 | CHECK_GOTO(BN_one(a)); | 950 | CHECK_GOTO(BN_one(a)); |
951 | CHECK_GOTO(BN_one(b)); | 951 | CHECK_GOTO(BN_one(b)); |
952 | CHECK_GOTO(BN_zero(c)); | 952 | BN_zero(c); |
953 | if (BN_mod_mul(e, a, b, c, ctx)) { | 953 | if (BN_mod_mul(e, a, b, c, ctx)) { |
954 | fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n"); | 954 | fprintf(stderr, "BN_mod_mul with zero modulus succeeded!\n"); |
955 | goto err; | 955 | goto err; |
@@ -1033,7 +1033,7 @@ test_mod_exp(BIO *bp, BN_CTX *ctx) | |||
1033 | 1033 | ||
1034 | CHECK_GOTO(BN_one(a)); | 1034 | CHECK_GOTO(BN_one(a)); |
1035 | CHECK_GOTO(BN_one(b)); | 1035 | CHECK_GOTO(BN_one(b)); |
1036 | CHECK_GOTO(BN_zero(c)); | 1036 | BN_zero(c); |
1037 | if (BN_mod_exp(d, a, b, c, ctx)) { | 1037 | if (BN_mod_exp(d, a, b, c, ctx)) { |
1038 | fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); | 1038 | fprintf(stderr, "BN_mod_exp with zero modulus succeeded!\n"); |
1039 | goto err; | 1039 | goto err; |
@@ -1166,7 +1166,7 @@ test_mod_exp_mont_consttime(BIO *bp, BN_CTX *ctx) | |||
1166 | 1166 | ||
1167 | CHECK_GOTO(BN_one(a)); | 1167 | CHECK_GOTO(BN_one(a)); |
1168 | CHECK_GOTO(BN_one(b)); | 1168 | CHECK_GOTO(BN_one(b)); |
1169 | CHECK_GOTO(BN_zero(c)); | 1169 | BN_zero(c); |
1170 | if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { | 1170 | if (BN_mod_exp_mont_consttime(d, a, b, c, ctx, NULL)) { |
1171 | fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " | 1171 | fprintf(stderr, "BN_mod_exp_mont_consttime with zero modulus " |
1172 | "succeeded\n"); | 1172 | "succeeded\n"); |
@@ -1255,7 +1255,7 @@ test_mod_exp_mont5(BIO *bp, BN_CTX *ctx) | |||
1255 | CHECK_GOTO(BN_bntest_rand(m, 1024, 0, 1)); /* must be odd for montgomery */ | 1255 | CHECK_GOTO(BN_bntest_rand(m, 1024, 0, 1)); /* must be odd for montgomery */ |
1256 | /* Zero exponent */ | 1256 | /* Zero exponent */ |
1257 | CHECK_GOTO(BN_bntest_rand(a, 1024, 0, 0)); | 1257 | CHECK_GOTO(BN_bntest_rand(a, 1024, 0, 0)); |
1258 | CHECK_GOTO(BN_zero(p)); | 1258 | BN_zero(p); |
1259 | if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) | 1259 | if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) |
1260 | goto err; | 1260 | goto err; |
1261 | if (!BN_is_one(d)) { | 1261 | if (!BN_is_one(d)) { |
@@ -1337,7 +1337,7 @@ test_mod_exp_mont5(BIO *bp, BN_CTX *ctx) | |||
1337 | } | 1337 | } |
1338 | /* Zero input */ | 1338 | /* Zero input */ |
1339 | CHECK_GOTO(BN_bntest_rand(p, 1024, 0, 0)); | 1339 | CHECK_GOTO(BN_bntest_rand(p, 1024, 0, 0)); |
1340 | CHECK_GOTO(BN_zero(a)); | 1340 | BN_zero(a); |
1341 | if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) | 1341 | if (!BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)) |
1342 | goto err; | 1342 | goto err; |
1343 | if (!BN_is_zero(d)) { | 1343 | if (!BN_is_zero(d)) { |