diff options
Diffstat (limited to '')
| -rw-r--r-- | src/regress/lib/libcrypto/bn/bn_mod_exp.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_mod_exp.c b/src/regress/lib/libcrypto/bn/bn_mod_exp.c index c7963d2a29..bab6ad4adf 100644 --- a/src/regress/lib/libcrypto/bn/bn_mod_exp.c +++ b/src/regress/lib/libcrypto/bn/bn_mod_exp.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_mod_exp.c,v 1.8 2022/12/03 09:37:02 tb Exp $ */ | 1 | /* $OpenBSD: bn_mod_exp.c,v 1.9 2022/12/03 09:44:52 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 | * |
| @@ -103,14 +103,12 @@ test_mod_exp(const BIGNUM *result_simple, const BIGNUM *a, const BIGNUM *b, | |||
| 103 | 103 | ||
| 104 | if (test->mod_exp_fn != NULL) { | 104 | if (test->mod_exp_fn != NULL) { |
| 105 | if (!test->mod_exp_fn(result, a, b, m, ctx)) { | 105 | if (!test->mod_exp_fn(result, a, b, m, ctx)) { |
| 106 | fprintf(stderr, "%s problems\n", test->name); | 106 | printf("%s() problems\n", test->name); |
| 107 | ERR_print_errors_fp(stderr); | ||
| 108 | goto err; | 107 | goto err; |
| 109 | } | 108 | } |
| 110 | } else { | 109 | } else { |
| 111 | if (!test->mod_exp_mont_fn(result, a, b, m, ctx, NULL)) { | 110 | if (!test->mod_exp_mont_fn(result, a, b, m, ctx, NULL)) { |
| 112 | fprintf(stderr, "%s problems\n", test->name); | 111 | printf("%s() problems\n", test->name); |
| 113 | ERR_print_errors_fp(stderr); | ||
| 114 | goto err; | 112 | goto err; |
| 115 | } | 113 | } |
| 116 | } | 114 | } |
| @@ -150,8 +148,6 @@ main(int argc, char *argv[]) | |||
| 150 | int c, i; | 148 | int c, i; |
| 151 | size_t j; | 149 | size_t j; |
| 152 | 150 | ||
| 153 | ERR_load_BN_strings(); | ||
| 154 | |||
| 155 | if ((ctx = BN_CTX_new()) == NULL) | 151 | if ((ctx = BN_CTX_new()) == NULL) |
| 156 | goto err; | 152 | goto err; |
| 157 | 153 | ||
| @@ -199,12 +195,13 @@ main(int argc, char *argv[]) | |||
| 199 | 195 | ||
| 200 | BN_CTX_end(ctx); | 196 | BN_CTX_end(ctx); |
| 201 | BN_CTX_free(ctx); | 197 | BN_CTX_free(ctx); |
| 202 | ERR_remove_thread_state(NULL); | ||
| 203 | 198 | ||
| 204 | return (0); | 199 | return 0; |
| 205 | 200 | ||
| 206 | err: | 201 | err: |
| 207 | ERR_load_crypto_strings(); | 202 | BN_CTX_end(ctx); |
| 203 | BN_CTX_free(ctx); | ||
| 208 | ERR_print_errors_fp(stdout); | 204 | ERR_print_errors_fp(stdout); |
| 209 | return (1); | 205 | |
| 206 | return 1; | ||
| 210 | } | 207 | } |
