asn1: Support dates before 1970-01-01 (i.e. when time_t gets negative)

On x86 we allow "overflows" around 1969/1970 but not for other dates.

Fixes #509.
This commit is contained in:
Tobias Brunner
2014-02-12 13:54:05 +01:00
parent addc34d5f0
commit ebc665be4d
3 changed files with 29 additions and 4 deletions
@@ -490,6 +490,12 @@ START_TEST(test_asn1_to_time)
{ 0, 0x17, "7001010260Z" },
{ 0, 0x17, "7001010203-1Z" },
{ 0, 0x17, "700101020361Z" },
{ -631152000, 0x17, "500101000000Z" }, /* UTCTime min */
{ 59, 0x17, "691231235959-0001" },
{ -1, 0x17, "691231235959Z" },
{ 0, 0x17, "700101000000Z" },
{ -60, 0x17, "700101000000+0001" },
{ 2524607999UL, 0x17, "491231235959Z" }, /* UTCTime max */
{ 5097600, 0x17, "7003010000Z" },
{ 68256000, 0x17, "7203010000Z" },
{ 951868800, 0x17, "0003010000Z" },