diff options
| -rw-r--r-- | src/regress/lib/libcrypto/bn/bn_to_string.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/regress/lib/libcrypto/bn/bn_to_string.c b/src/regress/lib/libcrypto/bn/bn_to_string.c index 7cbafbfe7d..93945b8733 100644 --- a/src/regress/lib/libcrypto/bn/bn_to_string.c +++ b/src/regress/lib/libcrypto/bn/bn_to_string.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: bn_to_string.c,v 1.4 2023/04/10 13:57:32 tb Exp $ */ | 1 | /* $OpenBSD: bn_to_string.c,v 1.5 2023/04/10 21:00:16 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> |
| 4 | * | 4 | * |
| @@ -22,14 +22,10 @@ | |||
| 22 | 22 | ||
| 23 | #include <openssl/x509v3.h> | 23 | #include <openssl/x509v3.h> |
| 24 | 24 | ||
| 25 | char *bn_to_string(const BIGNUM *bn); | 25 | struct bn_to_string_tests { |
| 26 | |||
| 27 | struct convert_st { | ||
| 28 | const char *input; | 26 | const char *input; |
| 29 | const char *want; | 27 | const char *want; |
| 30 | }; | 28 | } testcases[] = { |
| 31 | |||
| 32 | struct convert_st testcases[] = { | ||
| 33 | { | 29 | { |
| 34 | .input = "0x0", | 30 | .input = "0x0", |
| 35 | .want = "0", | 31 | .want = "0", |
| @@ -232,12 +228,12 @@ struct convert_st testcases[] = { | |||
| 232 | }; | 228 | }; |
| 233 | 229 | ||
| 234 | int | 230 | int |
| 235 | main(int argc, char *argv[]) | 231 | main(void) |
| 236 | { | 232 | { |
| 237 | struct convert_st *test; | 233 | struct bn_to_string_tests *test; |
| 238 | ASN1_INTEGER *aint; | 234 | ASN1_INTEGER *aint; |
| 239 | char *got; | 235 | char *got; |
| 240 | int failed = 0; | 236 | int failed = 0; |
| 241 | 237 | ||
| 242 | for (test = testcases; test->input != NULL; test++) { | 238 | for (test = testcases; test->input != NULL; test++) { |
| 243 | if ((aint = s2i_ASN1_INTEGER(NULL, test->input)) == NULL) | 239 | if ((aint = s2i_ASN1_INTEGER(NULL, test->input)) == NULL) |
