SleekXMPP
SleekXMPP copied to clipboard
conform to RFC5280 when extracting certificates validity dates
As per https://tools.ietf.org/html/rfc5280#section-4.1.2.5.1 :
4.1.2.5.1. UTCTime
The universal time type, UTCTime, is a standard ASN.1 type intended
for representation of dates and time. UTCTime specifies the year
through the two low-order digits and time is specified to the
precision of one minute or one second. UTCTime includes either Z
(for Zulu, or Greenwich Mean Time) or a time differential.
For the purposes of this profile, UTCTime values MUST be expressed in
Greenwich Mean Time (Zulu) and MUST include seconds (i.e., times are
YYMMDDHHMMSSZ), even where the number of seconds is zero. Conforming
systems MUST interpret the year field (YY) as follows:
Where YY is greater than or equal to 50, the year SHALL be
interpreted as 19YY; and
Where YY is less than 50, the year SHALL be interpreted as 20YY.
Without this patch I get an expired certificat warning on perfectly valid certificates.
I'm getting this error too.
Ping.
@bdauvergne Can you look with "master"?
It seems fixed by current code but I cannot confirm it as I'm not using sleekxmpp anymore (but the code is formally false here and in pyasn1, strptime %y does not have the proper semantic of UTCTime, which is > 2000, for YY < 50 and < 2000 for YY > 50, the threshold for %y is 1969; not sure all this code will live until 2050.