gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available (GH-118425)

This commit is contained in:
Alexander Kanavin 2024-05-03 15:34:05 +02:00 committed by GitHub
parent ca269e58c2
commit 37ccf16786
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -0,0 +1 @@
Use a Y2038 compatible openssl time function when available.

View File

@ -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,