[Cryptography-dev] Should datetime objects returned by not_valid_before, etc contain timezone info?

Erik Trauschke erik.trauschke at gmail.com
Wed Nov 25 10:57:28 EST 2015


I noticed that when ever we return datetime objects which come out of
backend.py`_parse_asn1_time(), they don't have a tzinfo attached.

Afaik, these values should always be UTC but for someone consuming
just the result of not_valid_before, etc. that might not be clear. I
think it should be possible to add this to _parse_asn1_time() so that
we indicate that these are UTC times.

I know it's a bit painful in Python <3.2 because we have to implement
the tzinfo class ourself but it's also not that much code.

Erik


More information about the Cryptography-dev mailing list