-/* $OpenBSD: asn1time.c,v 1.17 2023/08/30 10:13:12 job Exp $ */
+/* $OpenBSD: asn1time.c,v 1.18 2023/10/02 09:42:58 tb Exp $ */
/*
* Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
*
time_t time;
};
-struct asn1_time_test asn1_invtime_tests[] = {
+static const struct asn1_time_test asn1_invtime_tests[] = {
{
.str = "",
},
},
};
-struct asn1_time_test asn1_invgentime_tests[] = {
+static const struct asn1_time_test asn1_invgentime_tests[] = {
/* Generalized time with omitted seconds, should fail */
{
.str = "201612081934Z",
},
};
-struct asn1_time_test asn1_goodtime_tests[] = {
- {
- .str = "99990908234339Z",
- .time = 1,
- },
- {
- .str = "201612081934Z",
- .time = 1,
- },
- {
- .str = "1609082343Z",
- .time = 0,
- },
-};
-
-struct asn1_time_test asn1_gentime_tests[] = {
+static const struct asn1_time_test asn1_gentime_tests[] = {
{
.str = "20161208193400Z",
.data = "20161208193400Z",
},
};
-struct asn1_time_test asn1_utctime_tests[] = {
+static const struct asn1_time_test asn1_utctime_tests[] = {
{
.str = "700101000000Z",
.data = "700101000000Z",
}
static int
-asn1_compare_str(int test_no, struct asn1_string_st *asn1str, const char *str)
+asn1_compare_str(int test_no, const struct asn1_string_st *asn1str,
+ const char *str)
{
int length = strlen(str);
}
static int
-asn1_invtime_test(int test_no, struct asn1_time_test *att, int gen)
+asn1_invtime_test(int test_no, const struct asn1_time_test *att, int gen)
{
ASN1_GENERALIZEDTIME *gt = NULL;
ASN1_UTCTIME *ut = NULL;
}
static int
-asn1_gentime_test(int test_no, struct asn1_time_test *att)
+asn1_gentime_test(int test_no, const struct asn1_time_test *att)
{
const unsigned char *der;
unsigned char *p = NULL;
}
static int
-asn1_utctime_test(int test_no, struct asn1_time_test *att)
+asn1_utctime_test(int test_no, const struct asn1_time_test *att)
{
const unsigned char *der;
unsigned char *p = NULL;
}
static int
-asn1_time_test(int test_no, struct asn1_time_test *att, int type)
+asn1_time_test(int test_no, const struct asn1_time_test *att, int type)
{
ASN1_TIME *t = NULL, *tx509 = NULL;
int failure = 1;
int
main(int argc, char **argv)
{
- struct asn1_time_test *att;
+ const struct asn1_time_test *att;
int failed = 0;
size_t i;