From a52db025de436ee457084aebc6f2d9113f69250e Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 16 Sep 2022 08:58:34 -0400 Subject: Move away from the SSLEAY name (#1144) --- CHANGELOG.rst | 4 ++++ doc/api/ssl.rst | 24 +++++++++++++++--------- src/OpenSSL/SSL.py | 24 ++++++++++++++++-------- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index e1546f7..8691102 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -19,6 +19,10 @@ Backward-incompatible changes: Deprecations: ^^^^^^^^^^^^^ +- ``OpenSSL.SSL.SSLeay_version`` is deprecated in favor of + ``OpenSSL.SSL.OpenSSL_version``. The constants ``OpenSSL.SSL.SSLEAY_*`` are + deprecated in favor of ``OpenSSL.SSL.OPENSSL_*``. + Changes: ^^^^^^^^ diff --git a/doc/api/ssl.rst b/doc/api/ssl.rst index e788cf1..01c9e03 100644 --- a/doc/api/ssl.rst +++ b/doc/api/ssl.rst @@ -98,14 +98,20 @@ Context, Connection. :py:const:`OP_NO_*` constant may be undefined. -.. py:data:: SSLEAY_VERSION - SSLEAY_CFLAGS - SSLEAY_BUILT_ON - SSLEAY_PLATFORM - SSLEAY_DIR - - Constants used with :py:meth:`SSLeay_version` to specify what OpenSSL version - information to retrieve. See the man page for the :py:func:`SSLeay_version` C +.. py:data:: OPENSSL_VERSION + OPENSSL_CFLAGS + OPENSSL_BUILT_ON + OPENSSL_PLATFORM + OPENSSL_DIR + + .. versionchanged:: 22.1.0 + + Previously these were all named ``SSLEAY_*``. Those names are still + available for backwards compatibility, but the ``OPENSSL_*`` names are + preferred. + + Constants used with :py:meth:`OpenSSL_version` to specify what OpenSSL version + information to retrieve. See the man page for the :py:func:`OpenSSL_version` C API for details. @@ -141,7 +147,7 @@ Context, Connection. .. versionadded:: 19.1 -.. autofunction:: SSLeay_version +.. autofunction:: OpenSSL_version .. py:data:: ContextType diff --git a/src/OpenSSL/SSL.py b/src/OpenSSL/SSL.py index 6a3318c..2ee5b18 100644 --- a/src/OpenSSL/SSL.py +++ b/src/OpenSSL/SSL.py @@ -32,6 +32,11 @@ __all__ = [ "SSLEAY_PLATFORM", "SSLEAY_DIR", "SSLEAY_BUILT_ON", + "OPENSSL_VERSION", + "OPENSSL_CFLAGS", + "OPENSSL_PLATFORM", + "OPENSSL_DIR", + "OPENSSL_BUILT_ON", "SENT_SHUTDOWN", "RECEIVED_SHUTDOWN", "SSLv23_METHOD", @@ -125,11 +130,11 @@ __all__ = [ OPENSSL_VERSION_NUMBER = _lib.OPENSSL_VERSION_NUMBER -SSLEAY_VERSION = _lib.SSLEAY_VERSION -SSLEAY_CFLAGS = _lib.SSLEAY_CFLAGS -SSLEAY_PLATFORM = _lib.SSLEAY_PLATFORM -SSLEAY_DIR = _lib.SSLEAY_DIR -SSLEAY_BUILT_ON = _lib.SSLEAY_BUILT_ON +OPENSSL_VERSION = SSLEAY_VERSION = _lib.OPENSSL_VERSION +OPENSSL_CFLAGS = SSLEAY_CFLAGS = _lib.OPENSSL_CFLAGS +OPENSSL_PLATFORM = SSLEAY_PLATFORM = _lib.OPENSSL_PLATFORM +OPENSSL_DIR = SSLEAY_DIR = _lib.OPENSSL_DIR +OPENSSL_BUILT_ON = SSLEAY_BUILT_ON = _lib.OPENSSL_BUILT_ON SENT_SHUTDOWN = _lib.SSL_SENT_SHUTDOWN RECEIVED_SHUTDOWN = _lib.SSL_RECEIVED_SHUTDOWN @@ -614,13 +619,16 @@ def _asFileDescriptor(obj): return fd -def SSLeay_version(type): +def OpenSSL_version(type): """ Return a string describing the version of OpenSSL in use. - :param type: One of the :const:`SSLEAY_` constants defined in this module. + :param type: One of the :const:`OPENSSL_` constants defined in this module. """ - return _ffi.string(_lib.SSLeay_version(type)) + return _ffi.string(_lib.OpenSSL_version(type)) + + +SSLeay_version = OpenSSL_version def _make_requires(flag, error): -- cgit v1.2.1