Subject: | timegm should be called with 4-digit year |
man Time::Local says
Whenever possible, use an absolute four digit year instead.
With a detailed explanation about ambiguity of 2-digit years above that.
Please review/test/merge the attached patch (not tested)
Subject: | fix.patch |
Index: Convert-BER-1.32/BER.pm
===================================================================
--- Convert-BER-1.32.orig/BER.pm
+++ Convert-BER-1.32/BER.pm
@@ -1874,11 +1874,11 @@ sub unpack {
$offset -= ($s - int($s));
}
$M -= 1;
- if($isgen) { # GeneralizedTime uses 4-digit years
- $Y -= 1900;
- }
- elsif($Y <= 50) { # ASN.1 UTCTime
- $Y += 100; # specifies <=50 = 2000..2050, >50 = 1951..1999
+ if(!$isgen) { # GeneralizedTime already uses 4-digit years
+ if($Y <= 50) { # ASN.1 UTCTime
+ $Y += 100; # specifies <=50 = 2000..2050, >50 = 1951..1999
+ }
+ $Y += 1900;
}
require Time::Local;
$$arg = Time::Local::timegm(int($s),$m,$h,$D,$M,$Y) - $offset;