aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/_cffi_src/openssl/cryptography.py4
-rw-r--r--src/_cffi_src/openssl/ssl.py5
-rw-r--r--tests/hazmat/backends/test_openssl.py2
3 files changed, 9 insertions, 2 deletions
diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py
index 69824010..2ab13752 100644
--- a/src/_cffi_src/openssl/cryptography.py
+++ b/src/_cffi_src/openssl/cryptography.py
@@ -32,6 +32,8 @@ INCLUDES = """
(OPENSSL_VERSION_NUMBER < 0x10002000)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102BETA3 \
(OPENSSL_VERSION_NUMBER < 0x10002003)
+#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I \
+ (OPENSSL_VERSION_NUMBER < 0x1000209fL)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110 \
(OPENSSL_VERSION_NUMBER < 0x10100000)
#define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110PRE5 \
@@ -51,6 +53,8 @@ static const int CRYPTOGRAPHY_OPENSSL_110_OR_GREATER;
static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_101;
+static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I;
+
static const int CRYPTOGRAPHY_IS_LIBRESSL;
"""
diff --git a/src/_cffi_src/openssl/ssl.py b/src/_cffi_src/openssl/ssl.py
index 6e59d859..db884b35 100644
--- a/src/_cffi_src/openssl/ssl.py
+++ b/src/_cffi_src/openssl/ssl.py
@@ -664,7 +664,10 @@ static const long Cryptography_HAS_SET_CERT_CB = 1;
#endif
-#if defined(OPENSSL_NO_COMP) || defined(LIBRESSL_VERSION_NUMBER)
+/* In OpenSSL 1.0.2i+ the handling of COMP_METHOD when OPENSSL_NO_COMP was
+ changed and we no longer need to typedef void */
+#if (defined(OPENSSL_NO_COMP) && CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I) || \
+ defined(LIBRESSL_VERSION_NUMBER)
static const long Cryptography_HAS_COMPRESSION = 0;
typedef void COMP_METHOD;
#else
diff --git a/tests/hazmat/backends/test_openssl.py b/tests/hazmat/backends/test_openssl.py
index bf794c3a..db3c19b8 100644
--- a/tests/hazmat/backends/test_openssl.py
+++ b/tests/hazmat/backends/test_openssl.py
@@ -729,7 +729,7 @@ class TestGOSTCertificate(object):
backend
)
if (
- not backend._lib.CRYPTOGRAPHY_OPENSSL_110_OR_GREATER or
+ backend._lib.CRYPTOGRAPHY_OPENSSL_LESS_THAN_102I or
backend._lib.CRYPTOGRAPHY_IS_LIBRESSL
):
with pytest.raises(ValueError) as exc: