diff options
| author | Alexander Kanavin <alex.kanavin@gmail.com> | 2024-05-03 13:34:05 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-03 13:34:05 (GMT) |
| commit | 37ccf167869d101c4021c435868b7f89ccda8148 (patch) | |
| tree | 74910d5c5a1d736dba81ad932999812b215d4d7a | |
| parent | ca269e58c290be8ca11bb728004ea842d9f85e3a (diff) | |
| download | cpython-37ccf167869d101c4021c435868b7f89ccda8148.zip cpython-37ccf167869d101c4021c435868b7f89ccda8148.tar.gz cpython-37ccf167869d101c4021c435868b7f89ccda8148.tar.bz2 | |
gh-101732: Modules/_ssl.c: use Y2038 compatible openssl function when available (GH-118425)
| -rw-r--r-- | Misc/NEWS.d/next/Library/2024-04-30-12-59-04.gh-issue-101732.29zUDu.rst | 1 | ||||
| -rw-r--r-- | Modules/_ssl.c | 4 |
2 files changed, 5 insertions, 0 deletions
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 0000000..354dfc4 --- /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 f7fdbf4..885a9c2 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, |
