View | Details | Raw Unified | Return to bug 255241
Collapse All | Expand All

(-)security/py-cryptography/files/patch-Fix-build-with-LibreSSL-3.3.2-5988 (-1 / +62 lines)
Added Link Here
0
- 
1
From 94590a9aecc9e5ef6fc8eda52bae43643a4c44bd Mon Sep 17 00:00:00 2001
2
From: Charlie Li <vishwin@users.noreply.github.com>
3
Date: Mon, 19 Apr 2021 18:38:38 -0400
4
Subject: [PATCH] Fix build with LibreSSL 3.3.2 (#5988)
5
6
* LibreSSL 3.3.2 supports SSL_OP_NO_DTLS*
7
8
While here, bump CI
9
10
* Fix preprocessor guards for LibreSSL's SSL_OP_NO_DTLS*
11
12
DTLS_set_link_mtu and DTLS_get_link_min_mtu are not part of 3.3.2
13
14
* Switch to LESS_THAN context for LibreSSL 3.3.2
15
16
While here, fix indents
17
18
* Remove extra C variable declaration
19
20
The variable is not actually used from Python
21
---
22
 .github/workflows/ci.yml              | 2 +-
23
 src/_cffi_src/openssl/cryptography.py | 7 +++++++
24
 src/_cffi_src/openssl/ssl.py          | 2 ++
25
 3 files changed, 10 insertions(+), 1 deletion(-)
26
27
diff --git src/_cffi_src/openssl/cryptography.py src/_cffi_src/openssl/cryptography.py
28
index e2b5a132..b9c7a793 100644
29
--- src/_cffi_src/openssl/cryptography.py
30
+++ src/_cffi_src/openssl/cryptography.py
31
@@ -32,6 +32,13 @@ INCLUDES = """
32
 #include <Winsock2.h>
33
 #endif
34
 
35
+#if CRYPTOGRAPHY_IS_LIBRESSL
36
+#define CRYPTOGRAPHY_LIBRESSL_LESS_THAN_332 \
37
+    (LIBRESSL_VERSION_NUMBER < 0x3030200f)
38
+#else
39
+#define CRYPTOGRAPHY_LIBRESSL_LESS_THAN_332 (0)
40
+#endif
41
+
42
 #define CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER \
43
     (OPENSSL_VERSION_NUMBER >= 0x1010006f && !CRYPTOGRAPHY_IS_LIBRESSL)
44
 
45
diff --git src/_cffi_src/openssl/ssl.py src/_cffi_src/openssl/ssl.py
46
index 11a7d63a..081ef041 100644
47
--- src/_cffi_src/openssl/ssl.py
48
+++ src/_cffi_src/openssl/ssl.py
49
@@ -586,8 +586,10 @@ static const long TLS_ST_OK = 0;
50
 #endif
51
 
52
 #if CRYPTOGRAPHY_IS_LIBRESSL
53
+#if CRYPTOGRAPHY_LIBRESSL_LESS_THAN_332
54
 static const long SSL_OP_NO_DTLSv1 = 0;
55
 static const long SSL_OP_NO_DTLSv1_2 = 0;
56
+#endif
57
 long (*DTLS_set_link_mtu)(SSL *, long) = NULL;
58
 long (*DTLS_get_link_min_mtu)(SSL *) = NULL;
59
 #endif
60
-- 
61
2.31.1
62

Return to bug 255241