SleekXMPP icon indicating copy to clipboard operation
SleekXMPP copied to clipboard

conform to RFC5280 when extracting certificates validity dates

Open bdauvergne opened this issue 7 years ago • 5 comments

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.

bdauvergne avatar Sep 28 '17 22:09 bdauvergne

Without this patch I get an expired certificat warning on perfectly valid certificates.

bdauvergne avatar Sep 28 '17 22:09 bdauvergne

I'm getting this error too.

lpsinger avatar Nov 21 '17 22:11 lpsinger

Ping.

bdauvergne avatar Oct 22 '18 14:10 bdauvergne

@bdauvergne Can you look with "master"?

Neustradamus avatar Apr 08 '19 01:04 Neustradamus

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.

bdauvergne avatar Apr 08 '19 16:04 bdauvergne