]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available ...
authorAlexander Kanavin <alex.kanavin@gmail.com>
Fri, 3 May 2024 13:34:05 +0000 (15:34 +0200)
committerGitHub <noreply@github.com>
Fri, 3 May 2024 13:34:05 +0000 (15:34 +0200)
Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst [new file with mode: 0644]
Modules/_ssl.c

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 (file)
index 0000000..354dfc4
--- /dev/null
@@ -0,0 +1 @@
+Use a Y2038 compatible openssl time function when available.
index f7fdbf4b6f90cbc664f667081db637616fac9c17..885a9c25967d2d787135abd144fd6d0845e45600 100644 (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,