summaryrefslogtreecommitdiff
path: root/src/_cffi_src
diff options
context:
space:
mode:
authorCharlie Li <vishwin@users.noreply.github.com>2021-04-19 18:38:38 -0400
committerGitHub <noreply@github.com>2021-04-19 18:38:38 -0400
commit94590a9aecc9e5ef6fc8eda52bae43643a4c44bd (patch)
tree5f14c4cf0d166349d0dd8e57e42cd7db2ab5c414 /src/_cffi_src
parent6db4e0fb859c11106e1633988bda4341fc6f949b (diff)
downloadcryptography-94590a9aecc9e5ef6fc8eda52bae43643a4c44bd.tar.gz
Fix build with LibreSSL 3.3.2 (#5988)
* LibreSSL 3.3.2 supports SSL_OP_NO_DTLS* While here, bump CI * Fix preprocessor guards for LibreSSL's SSL_OP_NO_DTLS* DTLS_set_link_mtu and DTLS_get_link_min_mtu are not part of 3.3.2 * Switch to LESS_THAN context for LibreSSL 3.3.2 While here, fix indents * Remove extra C variable declaration The variable is not actually used from Python
Diffstat (limited to 'src/_cffi_src')
-rw-r--r--src/_cffi_src/openssl/cryptography.py7
-rw-r--r--src/_cffi_src/openssl/ssl.py2
2 files changed, 9 insertions, 0 deletions
diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py
index e2b5a1323..b9c7a793b 100644
--- a/src/_cffi_src/openssl/cryptography.py
+++ b/src/_cffi_src/openssl/cryptography.py
@@ -32,6 +32,13 @@ INCLUDES = """
#include <Winsock2.h>
#endif
+#if CRYPTOGRAPHY_IS_LIBRESSL
+#define CRYPTOGRAPHY_LIBRESSL_LESS_THAN_332 \
+ (LIBRESSL_VERSION_NUMBER < 0x3030200f)
+#else
+#define CRYPTOGRAPHY_LIBRESSL_LESS_THAN_332 (0)
+#endif
+
#define CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER \
(OPENSSL_VERSION_NUMBER >= 0x1010006f && !CRYPTOGRAPHY_IS_LIBRESSL)
diff --git a/src/_cffi_src/openssl/ssl.py b/src/_cffi_src/openssl/ssl.py
index 11a7d63a9..081ef041f 100644
--- a/src/_cffi_src/openssl/ssl.py
+++ b/src/_cffi_src/openssl/ssl.py
@@ -586,8 +586,10 @@ static const long TLS_ST_OK = 0;
#endif
#if CRYPTOGRAPHY_IS_LIBRESSL
+#if CRYPTOGRAPHY_LIBRESSL_LESS_THAN_332
static const long SSL_OP_NO_DTLSv1 = 0;
static const long SSL_OP_NO_DTLSv1_2 = 0;
+#endif
long (*DTLS_set_link_mtu)(SSL *, long) = NULL;
long (*DTLS_get_link_min_mtu)(SSL *) = NULL;
#endif