summaryrefslogtreecommitdiff
path: root/devel/libevent/files/patch-libressl
blob: ff68c83343c91ec7afed3654ebb4496dc7ad983e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
LibreSSL uses a synthetic version in order to force consumers to check
individual features instead but API isn't compatible with OpenSSL 1.1.x.

https://github.com/libevent/libevent/commit/d057c45e8f48

--- openssl-compat.h.orig	2017-01-25 23:37:15 UTC
+++ openssl-compat.h
@@ -1,7 +1,7 @@
 #ifndef OPENSSL_COMPAT_H
 #define OPENSSL_COMPAT_H
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 
 static inline BIO_METHOD *BIO_meth_new(int type, const char *name)
 {
@@ -30,6 +30,6 @@ static inline BIO_METHOD *BIO_meth_new(i
 
 #define TLS_method SSLv23_method
 
-#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) */
 
 #endif /* OPENSSL_COMPAT_H */
--- sample/https-client.c.orig	2017-01-25 23:37:15 UTC
+++ sample/https-client.c
@@ -312,7 +312,7 @@ main(int argc, char **argv)
 	}
 	uri[sizeof(uri) - 1] = '\0';
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 	// Initialize OpenSSL
 	SSL_library_init();
 	ERR_load_crypto_strings();
@@ -480,7 +480,7 @@ cleanup:
 		SSL_CTX_free(ssl_ctx);
 	if (type == HTTP && ssl)
 		SSL_free(ssl);
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 	EVP_cleanup();
 	ERR_free_strings();
 
@@ -492,7 +492,7 @@ cleanup:
 	CRYPTO_cleanup_all_ex_data();
 
 	sk_SSL_COMP_free(SSL_COMP_get_compression_methods());
-#endif /*OPENSSL_VERSION_NUMBER < 0x10100000L */
+#endif /* (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER) */
 
 #ifdef _WIN32
 	WSACleanup();
--- sample/le-proxy.c.orig	2017-01-25 23:37:15 UTC
+++ sample/le-proxy.c
@@ -259,7 +259,7 @@ main(int argc, char **argv)
 
 	if (use_ssl) {
 		int r;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 		SSL_library_init();
 		ERR_load_crypto_strings();
 		SSL_load_error_strings();
--- sample/openssl_hostname_validation.c.orig	2017-01-25 23:37:15 UTC
+++ sample/openssl_hostname_validation.c
@@ -48,7 +48,7 @@ SOFTWARE.
 
 #define HOSTNAME_MAX_SIZE 255
 
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 #define ASN1_STRING_get0_data ASN1_STRING_data
 #endif
 
--- test/regress_ssl.c.orig	2017-01-25 23:37:15 UTC
+++ test/regress_ssl.c
@@ -186,7 +186,7 @@ get_ssl_ctx(void)
 void
 init_ssl(void)
 {
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
 	SSL_library_init();
 	ERR_load_crypto_strings();
 	SSL_load_error_strings();