-/* $OpenBSD: asn1time.c,v 1.3 2015/10/02 15:35:30 jsing Exp $ */
+/* $OpenBSD: asn1time.c,v 1.4 2015/10/19 16:29:22 beck Exp $ */
/*
* Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
*
0x5a,
},
},
- {
- .str = "20150923032700.22-0700",
- .data = "20150923102700Z",
- .time = 1443004020,
- .der = {
- 0x18, 0x16, 0x32, 0x30, 0x31, 0x35, 0x30, 0x39,
- 0x32, 0x33, 0x30, 0x33, 0x32, 0x37, 0x30, 0x30,
- 0x2e, 0x32, 0x32, 0x2d, 0x30, 0x37, 0x30, 0x30,
- },
- },
- {
- .str = "20150923032712+1100",
- .data = "20150922162712Z",
- .time = 1442939232,
- .der = {
- 0x18, 0x13, 0x32, 0x30, 0x31, 0x35, 0x30, 0x39,
- 0x32, 0x33, 0x30, 0x33, 0x32, 0x37, 0x31, 0x32,
- 0x2b, 0x31, 0x31, 0x30, 0x30,
- },
- },
- {
- .str = "20150923032712+1115",
- .data = "20150922161212Z",
- .time = 1442938332,
- .der = {
- 0x18, 0x13, 0x32, 0x30, 0x31, 0x35, 0x30, 0x39,
- 0x32, 0x33, 0x30, 0x33, 0x32, 0x37, 0x31, 0x32,
- 0x2b, 0x31, 0x31, 0x31, 0x35,
- },
- },
- {
- .str = "20150923032700.12345678Z",
- .data = "20150923032700Z",
- .time = 1442978820,
- .der = {
- 0x18, 0x18, 0x32, 0x30, 0x31, 0x35, 0x30, 0x39,
- 0x32, 0x33, 0x30, 0x33, 0x32, 0x37, 0x30, 0x30,
- 0x2e, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
- 0x38, 0x5a,
- },
- },
};
struct asn1_time_test asn1_utctime_tests[] = {
{
- .str = "7001010000Z",
+ .str = "700101000000Z",
.data = "700101000000Z",
.time = 0,
.der = {
- 0x17, 0x0b, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31,
- 0x30, 0x30, 0x30, 0x30, 0x5a,
+ 0x17, 0x0d, 0x37, 0x30, 0x30, 0x31, 0x30, 0x31,
+ 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x5a,
},
},
{
0x30, 0x33, 0x32, 0x37, 0x30, 0x30, 0x5a,
},
},
- {
- .str = "150923032700-0700",
- .data = "150923102700Z",
- .time = 1443004020,
- .der = {
- 0x17, 0x11, 0x31, 0x35, 0x30, 0x39, 0x32, 0x33,
- 0x30, 0x33, 0x32, 0x37, 0x30, 0x30, 0x2d, 0x30,
- 0x37, 0x30, 0x30,
- },
- },
- {
- .str = "150923032712+1100",
- .data = "150922162712Z",
- .time = 1442939232,
- .der = {
- 0x17, 0x11, 0x31, 0x35, 0x30, 0x39, 0x32, 0x33,
- 0x30, 0x33, 0x32, 0x37, 0x31, 0x32, 0x2b, 0x31,
- 0x31, 0x30, 0x30,
- },
- },
{
.str = "140524144512Z",
.data = "140524144512Z",