summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2023-04-10 21:00:16 +0000
committertb <>2023-04-10 21:00:16 +0000
commitb62f44a9758e7dcf86ce77ec568ea6f2a203aaf9 (patch)
tree8beb3f1deff50ac5203e5dedc26ddedcc0db9c23
parentc6b65d9038a9fb14b4975d79cc7985628b4ed9e2 (diff)
downloadopenbsd-b62f44a9758e7dcf86ce77ec568ea6f2a203aaf9.tar.gz
openbsd-b62f44a9758e7dcf86ce77ec568ea6f2a203aaf9.tar.bz2
openbsd-b62f44a9758e7dcf86ce77ec568ea6f2a203aaf9.zip
Some more cleanup in bn_to_string
-rw-r--r--src/regress/lib/libcrypto/bn/bn_to_string.c20
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
25char *bn_to_string(const BIGNUM *bn); 25struct bn_to_string_tests {
26
27struct convert_st {
28 const char *input; 26 const char *input;
29 const char *want; 27 const char *want;
30}; 28} testcases[] = {
31
32struct 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
234int 230int
235main(int argc, char *argv[]) 231main(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)