From: Alexander Kanavin Date: Fri, 3 May 2024 13:34:05 +0000 (+0200) Subject: gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available ... X-Git-Tag: v3.13.0b1~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=37ccf167869d101c4021c435868b7f89ccda8148;p=thirdparty%2FPython%2Fcpython.git gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available (GH-118425) --- diff --git a/Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst b/Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst new file mode 100644 index 000000000000..354dfc463620 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst @@ -0,0 +1 @@ +Use a Y2038 compatible openssl time function when available. diff --git a/Modules/_ssl.c b/Modules/_ssl.c index f7fdbf4b6f90..885a9c25967d 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c @@ -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,