Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -1641,10 +1641,11 @@ def set_time(self, vfy_time):
:param datetime vfy_time: The verification time to set on this store.
:return: ``None`` if the verification time was successfully set.
"""
import calendar
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imports should go at teh top of the file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved

param = _lib.X509_VERIFY_PARAM_new()
param = _ffi.gc(param, _lib.X509_VERIFY_PARAM_free)

_lib.X509_VERIFY_PARAM_set_time(param, int(vfy_time.strftime('%s')))
_lib.X509_VERIFY_PARAM_set_time(param, calendar.timegm(vfy_time.timetuple()))
_openssl_assert(_lib.X509_STORE_set1_param(self._store, param) != 0)


Expand Down