From 7bb1a6cf33c70622e249876e749b4a7ea7b98384 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 5 Sep 2022 21:06:31 +0000 Subject: [PATCH] Convert from %i to %d --- regress/lib/libcrypto/asn1/asn1basic.c | 4 +- regress/lib/libcrypto/asn1/asn1complex.c | 4 +- regress/lib/libcrypto/asn1/asn1evp.c | 12 ++--- regress/lib/libcrypto/asn1/asn1object.c | 4 +- regress/lib/libcrypto/asn1/asn1time.c | 58 ++++++++++----------- regress/lib/libcrypto/asn1/rfc5280time.c | 30 +++++------ regress/lib/libcrypto/base64/base64test.c | 18 +++---- regress/lib/libcrypto/bio/biotest.c | 10 ++-- regress/lib/libcrypto/bn/general/bntest.c | 4 +- regress/lib/libcrypto/engine/enginetest.c | 10 ++-- regress/lib/libcrypto/gcm128/gcm128test.c | 10 ++-- regress/lib/libcrypto/objects/objectstest.c | 4 +- 12 files changed, 84 insertions(+), 84 deletions(-) diff --git a/regress/lib/libcrypto/asn1/asn1basic.c b/regress/lib/libcrypto/asn1/asn1basic.c index 6ce27a27067..45f61ed8592 100644 --- a/regress/lib/libcrypto/asn1/asn1basic.c +++ b/regress/lib/libcrypto/asn1/asn1basic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1basic.c,v 1.11 2022/09/03 18:54:36 jsing Exp $ */ +/* $OpenBSD: asn1basic.c,v 1.12 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2017, 2021 Joel Sing * @@ -41,7 +41,7 @@ asn1_compare_bytes(const char *label, const unsigned char *d1, int len1, { if (len1 != len2) { fprintf(stderr, "FAIL: %s - byte lengths differ " - "(%i != %i)\n", label, len1, len2); + "(%d != %d)\n", label, len1, len2); fprintf(stderr, "Got:\n"); hexdump(d1, len1); fprintf(stderr, "Want:\n"); diff --git a/regress/lib/libcrypto/asn1/asn1complex.c b/regress/lib/libcrypto/asn1/asn1complex.c index e75ebc753e7..6f34154b7f3 100644 --- a/regress/lib/libcrypto/asn1/asn1complex.c +++ b/regress/lib/libcrypto/asn1/asn1complex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1complex.c,v 1.3 2022/04/28 18:36:38 jsing Exp $ */ +/* $OpenBSD: asn1complex.c,v 1.4 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2017, 2021 Joel Sing * @@ -40,7 +40,7 @@ asn1_compare_bytes(const char *label, const unsigned char *d1, int len1, { if (len1 != len2) { fprintf(stderr, "FAIL: %s - byte lengths differ " - "(%i != %i)\n", label, len1, len2); + "(%d != %d)\n", label, len1, len2); return 0; } if (memcmp(d1, d2, len1) != 0) { diff --git a/regress/lib/libcrypto/asn1/asn1evp.c b/regress/lib/libcrypto/asn1/asn1evp.c index 7e290d5db8b..0bf0a5fb9ec 100644 --- a/regress/lib/libcrypto/asn1/asn1evp.c +++ b/regress/lib/libcrypto/asn1/asn1evp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1evp.c,v 1.4 2021/04/06 16:30:27 tb Exp $ */ +/* $OpenBSD: asn1evp.c,v 1.5 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2017 Joel Sing * @@ -84,12 +84,12 @@ main(int argc, char **argv) goto done; } if (at->type != V_ASN1_SEQUENCE) { - fprintf(stderr, "FAIL: not a V_ASN1_SEQUENCE (%i != %i)\n", + fprintf(stderr, "FAIL: not a V_ASN1_SEQUENCE (%d != %d)\n", at->type, V_ASN1_SEQUENCE); goto done; } if (at->value.sequence->type != V_ASN1_OCTET_STRING) { - fprintf(stderr, "FAIL: not a V_ASN1_OCTET_STRING (%i != %i)\n", + fprintf(stderr, "FAIL: not a V_ASN1_OCTET_STRING (%d != %d)\n", at->type, V_ASN1_OCTET_STRING); goto done; } @@ -106,7 +106,7 @@ main(int argc, char **argv) goto done; } if (num != TEST_NUM) { - fprintf(stderr, "FAIL: got num %li, want %li\n", num, TEST_NUM); + fprintf(stderr, "FAIL: got num %ld, want %ld\n", num, TEST_NUM); goto done; } if (compare_data("octet string", data, len, @@ -126,11 +126,11 @@ main(int argc, char **argv) goto done; } if (num != TEST_NUM) { - fprintf(stderr, "FAIL: got num %li, want %li\n", num, TEST_NUM); + fprintf(stderr, "FAIL: got num %ld, want %ld\n", num, TEST_NUM); goto done; } if (len != sizeof(test_octetstring)) { - fprintf(stderr, "FAIL: got length mismatch (%i != %zu)\n", + fprintf(stderr, "FAIL: got length mismatch (%d != %zu)\n", len, sizeof(test_octetstring)); goto done; } diff --git a/regress/lib/libcrypto/asn1/asn1object.c b/regress/lib/libcrypto/asn1/asn1object.c index dee7c2410a4..3452a713a01 100644 --- a/regress/lib/libcrypto/asn1/asn1object.c +++ b/regress/lib/libcrypto/asn1/asn1object.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1object.c,v 1.8 2022/06/22 09:54:19 tb Exp $ */ +/* $OpenBSD: asn1object.c,v 1.9 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2017, 2021, 2022 Joel Sing * @@ -41,7 +41,7 @@ asn1_compare_bytes(const char *label, const unsigned char *d1, int len1, { if (len1 != len2) { fprintf(stderr, "FAIL: %s - byte lengths differ " - "(%i != %i)\n", label, len1, len2); + "(%d != %d)\n", label, len1, len2); fprintf(stderr, "Got:\n"); hexdump(d1, len1); fprintf(stderr, "Want:\n"); diff --git a/regress/lib/libcrypto/asn1/asn1time.c b/regress/lib/libcrypto/asn1/asn1time.c index 184256d664f..0adac08300e 100644 --- a/regress/lib/libcrypto/asn1/asn1time.c +++ b/regress/lib/libcrypto/asn1/asn1time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1time.c,v 1.15 2022/09/05 20:53:01 tb Exp $ */ +/* $OpenBSD: asn1time.c,v 1.16 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2015 Joel Sing * @@ -195,12 +195,12 @@ asn1_compare_bytes(int test_no, const unsigned char *d1, const unsigned char *d2, int len1, int len2) { if (len1 != len2) { - fprintf(stderr, "FAIL: test %i - byte lengths differ " - "(%i != %i)\n", test_no, len1, len2); + fprintf(stderr, "FAIL: test %d - byte lengths differ " + "(%d != %d)\n", test_no, len1, len2); return (1); } if (memcmp(d1, d2, len1) != 0) { - fprintf(stderr, "FAIL: test %i - bytes differ\n", test_no); + fprintf(stderr, "FAIL: test %d - bytes differ\n", test_no); fprintf(stderr, "Got:\n"); hexdump(d1, len1); fprintf(stderr, "Want:\n"); @@ -216,12 +216,12 @@ asn1_compare_str(int test_no, struct asn1_string_st *asn1str, const char *str) int length = strlen(str); if (asn1str->length != length) { - fprintf(stderr, "FAIL: test %i - string lengths differ " - "(%i != %i)\n", test_no, asn1str->length, length); + fprintf(stderr, "FAIL: test %d - string lengths differ " + "(%d != %d)\n", test_no, asn1str->length, length); return (1); } if (strncmp(asn1str->data, str, length) != 0) { - fprintf(stderr, "FAIL: test %i - strings differ " + fprintf(stderr, "FAIL: test %d - strings differ " "('%s' != '%s')\n", test_no, asn1str->data, str); return (1); } @@ -245,7 +245,7 @@ asn1_invtime_test(int test_no, struct asn1_time_test *att, int gen) goto done; if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 0) { - fprintf(stderr, "FAIL: test %i - successfully set " + fprintf(stderr, "FAIL: test %d - successfully set " "GENERALIZEDTIME string '%s'\n", test_no, att->str); goto done; } @@ -256,17 +256,17 @@ asn1_invtime_test(int test_no, struct asn1_time_test *att, int gen) } if (ASN1_UTCTIME_set_string(ut, att->str) != 0) { - fprintf(stderr, "FAIL: test %i - successfully set UTCTIME " + fprintf(stderr, "FAIL: test %d - successfully set UTCTIME " "string '%s'\n", test_no, att->str); goto done; } if (ASN1_TIME_set_string(t, att->str) != 0) { - fprintf(stderr, "FAIL: test %i - successfully set TIME " + fprintf(stderr, "FAIL: test %d - successfully set TIME " "string '%s'\n", test_no, att->str); goto done; } if (ASN1_TIME_set_string_X509(t, att->str) != 0) { - fprintf(stderr, "FAIL: test %i - successfully set x509 TIME " + fprintf(stderr, "FAIL: test %d - successfully set x509 TIME " "string '%s'\n", test_no, att->str); goto done; } @@ -292,7 +292,7 @@ asn1_gentime_test(int test_no, struct asn1_time_test *att) struct tm tm; if (ASN1_GENERALIZEDTIME_set_string(NULL, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -301,7 +301,7 @@ asn1_gentime_test(int test_no, struct asn1_time_test *att) goto done; if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -309,7 +309,7 @@ asn1_gentime_test(int test_no, struct asn1_time_test *att) goto done; if (ASN1_TIME_to_tm(gt, &tm) == 0) { - fprintf(stderr, "FAIL: test %i - ASN1_time_to_tm failed '%s'\n", + fprintf(stderr, "FAIL: test %d - ASN1_time_to_tm failed '%s'\n", test_no, att->str); goto done; } @@ -318,13 +318,13 @@ asn1_gentime_test(int test_no, struct asn1_time_test *att) /* things with crappy time_t should die in fire */ int64_t a = timegm(&tm); int64_t b = att->time; - fprintf(stderr, "FAIL: test %i - times don't match, expected %lld got %lld\n", + fprintf(stderr, "FAIL: test %d - times don't match, expected %lld got %lld\n", test_no, (long long)b, (long long)a); goto done; } if ((len = i2d_ASN1_GENERALIZEDTIME(gt, &p)) <= 0) { - fprintf(stderr, "FAIL: test %i - i2d_ASN1_GENERALIZEDTIME " + fprintf(stderr, "FAIL: test %d - i2d_ASN1_GENERALIZEDTIME " "failed\n", test_no); goto done; } @@ -334,7 +334,7 @@ asn1_gentime_test(int test_no, struct asn1_time_test *att) len = strlen(att->der); if (d2i_ASN1_GENERALIZEDTIME(>, &der, len) == NULL) { - fprintf(stderr, "FAIL: test %i - d2i_ASN1_GENERALIZEDTIME " + fprintf(stderr, "FAIL: test %d - d2i_ASN1_GENERALIZEDTIME " "failed\n", test_no); goto done; } @@ -344,7 +344,7 @@ asn1_gentime_test(int test_no, struct asn1_time_test *att) ASN1_GENERALIZEDTIME_free(gt); if ((gt = ASN1_GENERALIZEDTIME_set(NULL, att->time)) == NULL) { - fprintf(stderr, "FAIL: test %i - failed to set time %lli\n", + fprintf(stderr, "FAIL: test %d - failed to set time %lld\n", test_no, (long long)att->time); goto done; } @@ -370,7 +370,7 @@ asn1_utctime_test(int test_no, struct asn1_time_test *att) int len; if (ASN1_UTCTIME_set_string(NULL, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -379,7 +379,7 @@ asn1_utctime_test(int test_no, struct asn1_time_test *att) goto done; if (ASN1_UTCTIME_set_string(ut, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -387,7 +387,7 @@ asn1_utctime_test(int test_no, struct asn1_time_test *att) goto done; if ((len = i2d_ASN1_UTCTIME(ut, &p)) <= 0) { - fprintf(stderr, "FAIL: test %i - i2d_ASN1_UTCTIME failed\n", + fprintf(stderr, "FAIL: test %d - i2d_ASN1_UTCTIME failed\n", test_no); goto done; } @@ -397,7 +397,7 @@ asn1_utctime_test(int test_no, struct asn1_time_test *att) len = strlen(att->der); if (d2i_ASN1_UTCTIME(&ut, &der, len) == NULL) { - fprintf(stderr, "FAIL: test %i - d2i_ASN1_UTCTIME failed\n", + fprintf(stderr, "FAIL: test %d - d2i_ASN1_UTCTIME failed\n", test_no); goto done; } @@ -407,7 +407,7 @@ asn1_utctime_test(int test_no, struct asn1_time_test *att) ASN1_UTCTIME_free(ut); if ((ut = ASN1_UTCTIME_set(NULL, att->time)) == NULL) { - fprintf(stderr, "FAIL: test %i - failed to set time %lli\n", + fprintf(stderr, "FAIL: test %d - failed to set time %lld\n", test_no, (long long)att->time); goto done; } @@ -430,7 +430,7 @@ asn1_time_test(int test_no, struct asn1_time_test *att, int type) int failure = 1; if (ASN1_TIME_set_string(NULL, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -442,31 +442,31 @@ asn1_time_test(int test_no, struct asn1_time_test *att, int type) goto done; if (ASN1_TIME_set_string(t, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } if (t->type != type) { - fprintf(stderr, "FAIL: test %i - got type %i, want %i\n", + fprintf(stderr, "FAIL: test %d - got type %d, want %d\n", test_no, t->type, type); goto done; } if (ASN1_TIME_normalize(t) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set normalize '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set normalize '%s'\n", test_no, att->str); goto done; } if (ASN1_TIME_set_string_X509(tx509, t->data) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string X509 '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string X509 '%s'\n", test_no, t->data); goto done; } if (t->type != tx509->type) { - fprintf(stderr, "FAIL: test %i - type %d, different from %d\n", + fprintf(stderr, "FAIL: test %d - type %d, different from %d\n", test_no, t->type, tx509->type); goto done; } diff --git a/regress/lib/libcrypto/asn1/rfc5280time.c b/regress/lib/libcrypto/asn1/rfc5280time.c index 34e40439dcd..f9b561e5c9d 100644 --- a/regress/lib/libcrypto/asn1/rfc5280time.c +++ b/regress/lib/libcrypto/asn1/rfc5280time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfc5280time.c,v 1.4 2015/10/30 15:52:55 miod Exp $ */ +/* $OpenBSD: rfc5280time.c,v 1.5 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2015 Joel Sing * Copyright (c) 2015 Bob Beck @@ -191,12 +191,12 @@ asn1_compare_str(int test_no, struct asn1_string_st *asn1str, const char *str) int length = strlen(str); if (asn1str->length != length) { - fprintf(stderr, "FAIL: test %i - string lengths differ " - "(%i != %i)\n", test_no, asn1str->length, length); + fprintf(stderr, "FAIL: test %d - string lengths differ " + "(%d != %d)\n", test_no, asn1str->length, length); return (1); } if (strncmp(asn1str->data, str, length) != 0) { - fprintf(stderr, "FAIL: test %i - strings differ " + fprintf(stderr, "FAIL: test %d - strings differ " "('%s' != '%s')\n", test_no, asn1str->data, str); return (1); } @@ -222,21 +222,21 @@ rfc5280_invtime_test(int test_no, struct rfc5280_time_test *att) if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 0) { if (X509_cmp_time(gt, &now) != 0) { - fprintf(stderr, "FAIL: test %i - successfully parsed as GENTIME " + fprintf(stderr, "FAIL: test %d - successfully parsed as GENTIME " "string '%s'\n", test_no, att->str); goto done; } } if (ASN1_UTCTIME_set_string(ut, att->str) != 0) { if (X509_cmp_time(ut, &now) != 0) { - fprintf(stderr, "FAIL: test %i - successfully parsed as UTCTIME " + fprintf(stderr, "FAIL: test %d - successfully parsed as UTCTIME " "string '%s'\n", test_no, att->str); goto done; } } if (ASN1_TIME_set_string(t, att->str) != 0) { if (X509_cmp_time(t, &now) != 0) { - fprintf(stderr, "FAIL: test %i - successfully parsed as UTCTIME " + fprintf(stderr, "FAIL: test %d - successfully parsed as UTCTIME " "string '%s'\n", test_no, att->str); goto done; } @@ -264,7 +264,7 @@ rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att) goto done; if (ASN1_GENERALIZEDTIME_set_string(gt, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -272,14 +272,14 @@ rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att) goto done; if ((i = X509_cmp_time(gt, &att->time)) != -1) { - fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", + fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", test_no, i, att->time); goto done; } att->time--; if ((i = X509_cmp_time(gt, &att->time)) != 1) { - fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", + fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", test_no, i, att->time); goto done; } @@ -288,7 +288,7 @@ rfc5280_gentime_test(int test_no, struct rfc5280_time_test *att) ASN1_GENERALIZEDTIME_free(gt); if ((gt = ASN1_GENERALIZEDTIME_set(NULL, att->time)) == NULL) { - fprintf(stderr, "FAIL: test %i - failed to set time %lli\n", + fprintf(stderr, "FAIL: test %d - failed to set time %lld\n", test_no, (long long)att->time); goto done; } @@ -316,7 +316,7 @@ rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att) goto done; if (ASN1_UTCTIME_set_string(ut, att->str) != 1) { - fprintf(stderr, "FAIL: test %i - failed to set string '%s'\n", + fprintf(stderr, "FAIL: test %d - failed to set string '%s'\n", test_no, att->str); goto done; } @@ -324,14 +324,14 @@ rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att) goto done; if ((i = X509_cmp_time(ut, &att->time)) != -1) { - fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", + fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", test_no, i, att->time); goto done; } att->time--; if ((i = X509_cmp_time(ut, &att->time)) != 1) { - fprintf(stderr, "FAIL: test %i - X509_cmp_time failed - returned %d compared to %lld\n", + fprintf(stderr, "FAIL: test %d - X509_cmp_time failed - returned %d compared to %lld\n", test_no, i, att->time); goto done; } @@ -340,7 +340,7 @@ rfc5280_utctime_test(int test_no, struct rfc5280_time_test *att) ASN1_UTCTIME_free(ut); if ((ut = ASN1_UTCTIME_set(NULL, att->time)) == NULL) { - fprintf(stderr, "FAIL: test %i - failed to set time %lli\n", + fprintf(stderr, "FAIL: test %d - failed to set time %lld\n", test_no, (long long)att->time); goto done; } diff --git a/regress/lib/libcrypto/base64/base64test.c b/regress/lib/libcrypto/base64/base64test.c index a05bc107547..9ab2a407030 100644 --- a/regress/lib/libcrypto/base64/base64test.c +++ b/regress/lib/libcrypto/base64/base64test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: base64test.c,v 1.9 2021/03/21 14:06:29 tb Exp $ */ +/* $OpenBSD: base64test.c,v 1.10 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -304,13 +304,13 @@ base64_encoding_test(int test_no, struct base64_test *bt, int test_nl) len = BIO_write(bio_mem, bt->in, bt->in_len); if (len != bt->in_len) { - fprintf(stderr, "FAIL: test %i - only wrote %zi out of %zi " + fprintf(stderr, "FAIL: test %d - only wrote %zd out of %zd " "characters\n", test_no, len, bt->in_len); failure = 1; goto done; } if (BIO_flush(bio_mem) < 0) { - fprintf(stderr, "FAIL: test %i - flush failed\n", test_no); + fprintf(stderr, "FAIL: test %d - flush failed\n", test_no); failure = 1; goto done; } @@ -333,14 +333,14 @@ base64_encoding_test(int test_no, struct base64_test *bt, int test_nl) goto done; if (len != b64len) { - fprintf(stderr, "FAIL: test %i - encoding resulted in %zi " - "characters instead of %zi\n", test_no, len, b64len); + fprintf(stderr, "FAIL: test %d - encoding resulted in %zd " + "characters instead of %zd\n", test_no, len, b64len); failure = 1; goto done; } if (memcmp(buf, out, b64len) != 0) { - fprintf(stderr, "FAIL: test %i - encoding differs:\n", test_no); + fprintf(stderr, "FAIL: test %d - encoding differs:\n", test_no); fprintf(stderr, " encoding: "); for (i = 0; i < len; i++) fprintf(stderr, "%c", out[i]); @@ -400,8 +400,8 @@ base64_decoding_test(int test_no, struct base64_test *bt, int test_nl) */ len = BIO_read(bio_mem, buf, BUF_SIZE); if (len != bt->valid_len && (bt->in_len != 0 || len != -1)) { - fprintf(stderr, "FAIL: test %i - decoding resulted in %zi " - "characters instead of %zi\n", test_no, len, bt->valid_len); + fprintf(stderr, "FAIL: test %d - decoding resulted in %zd " + "characters instead of %zd\n", test_no, len, bt->valid_len); fprintf(stderr, " input: "); for (i = 0; i < inlen; i++) fprintf(stderr, "%c", input[i]); @@ -419,7 +419,7 @@ base64_decoding_test(int test_no, struct base64_test *bt, int test_nl) goto done; if (memcmp(bt->in, buf, bt->in_len) != 0) { - fprintf(stderr, "FAIL: test %i - decoding differs:\n", test_no); + fprintf(stderr, "FAIL: test %d - decoding differs:\n", test_no); fprintf(stderr, " decoding: "); for (i = 0; i < len; i++) fprintf(stderr, "0x%x ", buf[i]); diff --git a/regress/lib/libcrypto/bio/biotest.c b/regress/lib/libcrypto/bio/biotest.c index d31e51e4542..531913461ac 100644 --- a/regress/lib/libcrypto/bio/biotest.c +++ b/regress/lib/libcrypto/bio/biotest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: biotest.c,v 1.8 2022/02/19 16:00:57 jsing Exp $ */ +/* $OpenBSD: biotest.c,v 1.9 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2014, 2022 Joel Sing * @@ -97,14 +97,14 @@ do_bio_get_host_ip_tests(void) ret = BIO_get_host_ip(bgit->input, ip.c); if (ret != bgit->ret) { - fprintf(stderr, "FAIL: test %zi (\"%s\") %s, want %s\n", + fprintf(stderr, "FAIL: test %zd (\"%s\") %s, want %s\n", i, bgit->input, ret ? "success" : "failure", bgit->ret ? "success" : "failure"); failed = 1; continue; } if (ret && ntohl(ip.i) != bgit->ip) { - fprintf(stderr, "FAIL: test %zi (\"%s\") returned ip " + fprintf(stderr, "FAIL: test %zd (\"%s\") returned ip " "%x != %x\n", i, bgit->input, ntohl(ip.i), bgit->ip); failed = 1; @@ -129,14 +129,14 @@ do_bio_get_port_tests(void) ret = BIO_get_port(bgpt->input, &port); if (ret != bgpt->ret) { - fprintf(stderr, "FAIL: test %zi (\"%s\") %s, want %s\n", + fprintf(stderr, "FAIL: test %zd (\"%s\") %s, want %s\n", i, bgpt->input, ret ? "success" : "failure", bgpt->ret ? "success" : "failure"); failed = 1; continue; } if (ret && port != bgpt->port) { - fprintf(stderr, "FAIL: test %zi (\"%s\") returned port " + fprintf(stderr, "FAIL: test %zd (\"%s\") returned port " "%u != %u\n", i, bgpt->input, port, bgpt->port); failed = 1; } diff --git a/regress/lib/libcrypto/bn/general/bntest.c b/regress/lib/libcrypto/bn/general/bntest.c index 53cce74ae01..b9581a0cd93 100644 --- a/regress/lib/libcrypto/bn/general/bntest.c +++ b/regress/lib/libcrypto/bn/general/bntest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bntest.c,v 1.24 2021/12/29 23:00:32 tb Exp $ */ +/* $OpenBSD: bntest.c,v 1.25 2022/09/05 21:06:31 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -2133,7 +2133,7 @@ test_gf2m_mod_solve_quad(BIO *bp, BN_CTX *ctx) } } if (s == 0) { - fprintf(stderr, "All %i tests of GF(2^m) modular solve quadratic resulted in no roots;\n", num0); + fprintf(stderr, "All %d tests of GF(2^m) modular solve quadratic resulted in no roots;\n", num0); fprintf(stderr, "this is very unlikely and probably indicates an error.\n"); goto err; } diff --git a/regress/lib/libcrypto/engine/enginetest.c b/regress/lib/libcrypto/engine/enginetest.c index 123866259b2..40e598ab771 100644 --- a/regress/lib/libcrypto/engine/enginetest.c +++ b/regress/lib/libcrypto/engine/enginetest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enginetest.c,v 1.8 2018/07/17 17:06:49 tb Exp $ */ +/* $OpenBSD: enginetest.c,v 1.9 2022/09/05 21:06:31 tb Exp $ */ /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL * project 2000. */ @@ -73,7 +73,7 @@ static void display_engine_list(void) loop = 0; printf("listing available engine types\n"); while (h) { - printf("engine %i, id = \"%s\", name = \"%s\"\n", + printf("engine %d, id = \"%s\", name = \"%s\"\n", loop++, ENGINE_get_id(h), ENGINE_get_name(h)); h = ENGINE_get_next(h); } @@ -188,9 +188,9 @@ int main(int argc, char *argv[]) printf("About to beef up the engine-type list\n"); for (loop = 0; loop < 512; loop++) { - if (asprintf(&id, "id%i", loop) == -1) + if (asprintf(&id, "id%d", loop) == -1) goto end; - if (asprintf(&name, "Fake engine type %i", loop) == -1) + if (asprintf(&name, "Fake engine type %d", loop) == -1) goto end; if (((block[loop] = ENGINE_new()) == NULL) || @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) for (loop = 0; loop < 512; loop++) { if (!ENGINE_add(block[loop])) { - printf("\nAdding stopped at %i, (%s,%s)\n", + printf("\nAdding stopped at %d, (%s,%s)\n", loop, ENGINE_get_id(block[loop]), ENGINE_get_name(block[loop])); break; diff --git a/regress/lib/libcrypto/gcm128/gcm128test.c b/regress/lib/libcrypto/gcm128/gcm128test.c index 07c6128c0f1..def7653c7b6 100644 --- a/regress/lib/libcrypto/gcm128/gcm128test.c +++ b/regress/lib/libcrypto/gcm128/gcm128test.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gcm128test.c,v 1.6 2018/07/17 17:06:49 tb Exp $ */ +/* $OpenBSD: gcm128test.c,v 1.7 2022/09/05 21:06:31 tb Exp $ */ /* ==================================================================== * Copyright (c) 2010 The OpenSSL Project. All rights reserved. * @@ -880,12 +880,12 @@ do_gcm128_test(int test_no, struct gcm128_test *tv) if (tv->P_len > 0) CRYPTO_gcm128_encrypt(&ctx, tv->P, out, out_len); if (CRYPTO_gcm128_finish(&ctx, tv->T, 16)) { - fprintf(stderr, "TEST %i: CRYPTO_gcm128_finish failed\n", + fprintf(stderr, "TEST %d: CRYPTO_gcm128_finish failed\n", test_no); goto fail; } if (tv->C_len > 0 && memcmp(out, tv->C, out_len)) { - fprintf(stderr, "TEST %i: encrypt failed\n", test_no); + fprintf(stderr, "TEST %d: encrypt failed\n", test_no); goto fail; } @@ -897,12 +897,12 @@ do_gcm128_test(int test_no, struct gcm128_test *tv) if (tv->C_len > 0) CRYPTO_gcm128_decrypt(&ctx, tv->C, out, out_len); if (CRYPTO_gcm128_finish(&ctx, tv->T, 16)) { - fprintf(stderr, "TEST %i: CRYPTO_gcm128_finish failed\n", + fprintf(stderr, "TEST %d: CRYPTO_gcm128_finish failed\n", test_no); goto fail; } if (tv->P_len > 0 && memcmp(out, tv->P, out_len)) { - fprintf(stderr, "TEST %i: decrypt failed\n", test_no); + fprintf(stderr, "TEST %d: decrypt failed\n", test_no); goto fail; } diff --git a/regress/lib/libcrypto/objects/objectstest.c b/regress/lib/libcrypto/objects/objectstest.c index 597373efd29..dba38644cfb 100644 --- a/regress/lib/libcrypto/objects/objectstest.c +++ b/regress/lib/libcrypto/objects/objectstest.c @@ -1,4 +1,4 @@ -/* $OpenBSD: objectstest.c,v 1.5 2022/02/20 13:47:53 jsing Exp $ */ +/* $OpenBSD: objectstest.c,v 1.6 2022/09/05 21:06:31 tb Exp $ */ /* * Copyright (c) 2017, 2022 Joel Sing * @@ -38,7 +38,7 @@ obj_compare_bytes(const char *label, const unsigned char *d1, int len1, { if (len1 != len2) { fprintf(stderr, "FAIL: %s - byte lengths differ " - "(%i != %i)\n", label, len1, len2); + "(%d != %d)\n", label, len1, len2); fprintf(stderr, "Got:\n"); hexdump(d1, len1); fprintf(stderr, "Want:\n"); -- 2.20.1