Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle datetimes with time zone information in crypto.X509Store.set_time() #952

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

orosam
Copy link
Contributor

@orosam orosam commented Oct 26, 2020

#907 fixed the issue with set_time() not working on Windows.
It also changed set_time()'s behavior in an incompatible way: instead of
treating vfy_time always being in local time (regardless if it had a time
zone attached or not), it now treats vfy_time as a time in UTC.

This patch improves on that by taking the time zone into account, and also
documents the incompatible change.

Note that it is not always possible to convert a timestamp in an arbitrary
time zone into UTC unambiguously, due to repeated or skipped local times
around DST changes. The best is to use a timezone-aware vfy_time
using the UTC time zone.

…ime()

pyca#907 fixed the issue with set_time() not working on Windows.
It also changed set_time()'s behavior in an incompatible way: instead of
treating vfy_time always being in local time (regardless if it had a time
zone attached or not), it now treats vfy_time as a time in UTC.

This patch improves on that by taking the time zone into account, and also
documents the incompatible change.

Note that it is not always possible to convert a timestamp in an arbitrary
time zone into UTC unambiguously, due to repeated or skipped local times
around DST changes. The best is to use a timezone-aware vfy_time
using the UTC time zone.
@orosam orosam marked this pull request as ready for review October 26, 2020 15:49
@orosam
Copy link
Contributor Author

orosam commented Oct 26, 2020

Two checks appear to be failing due to cryptography no longer allowing OpenSSL 1.0.2.

@alex
Copy link
Member

alex commented Oct 26, 2020

flips table

Ok, I guess we'll need to figure that out before we can review your PR. THank you for sending it!

@alex
Copy link
Member

alex commented Oct 27, 2020

Is it possible to write a test case for this?

Base automatically changed from master to main February 13, 2021 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants