Skip to content

Commit

Permalink
gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when…
Browse files Browse the repository at this point in the history
… available (GH-118425)
  • Loading branch information
kanavin authored May 3, 2024
1 parent ca269e5 commit 37ccf16
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use a Y2038 compatible openssl time function when available.
4 changes: 4 additions & 0 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -5329,7 +5329,11 @@ PySSLSession_clear(PySSLSession *self)

static PyObject *
PySSLSession_get_time(PySSLSession *self, void *closure) {
#if OPENSSL_VERSION_NUMBER >= 0x30300000L
return _PyLong_FromTime_t(SSL_SESSION_get_time_ex(self->session));
#else
return PyLong_FromLong(SSL_SESSION_get_time(self->session));
#endif
}

PyDoc_STRVAR(PySSLSession_get_time_doc,
Expand Down

0 comments on commit 37ccf16

Please sign in to comment.