aboutsummaryrefslogtreecommitdiffstats
path: root/main/qt5-qtbase/libressl-compat.patch
blob: cc6d3aadbee07af64a92a2aa1ae3c5745bf7d51d (plain)
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
The checks for OPENSSL_VERSION_NUMBER > 0x10002000 are used to
enable openssl specific macros and functions which libressl
obviously does not provide, thus add some additional tests
to disable that code for libressl.

--- qtbase/src/network/ssl/qsslcontext_openssl.cpp	2015-06-29 22:04:46.000000000 +0200
+++ qtbase/src/network/ssl/qsslcontext_openssl.cpp	2015-07-04 03:51:25.926570550 +0200
@@ -338,7 +338,7 @@
 
     const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
     if (!qcurves.isEmpty()) {
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) && defined(SSL_CTRL_SET_CURVES)
         // Set the curves to be used
         if (q_SSLeay() >= 0x10002000L) {
             // SSL_CTX_ctrl wants a non-const pointer as last argument,
--- qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp	2015-06-29 22:04:46.000000000 +0200
+++ qtbase/src/network/ssl/qsslsocket_openssl_symbols.cpp	2015-07-04 03:58:29.430569295 +0200
@@ -406,7 +406,7 @@
 DEFINEFUNC(EC_KEY *, EC_KEY_new_by_curve_name, int nid, nid, return 0, return)
 DEFINEFUNC(void, EC_KEY_free, EC_KEY *ecdh, ecdh, return, DUMMYARG)
 DEFINEFUNC2(size_t, EC_get_builtin_curves, EC_builtin_curve * r, r, size_t nitems, nitems, return 0, return)
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) && !defined(LIBRESSL_VERSION_NUMBER)
 DEFINEFUNC(int, EC_curve_nist2nid, const char *name, name, return 0, return)
 #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
 #endif // OPENSSL_NO_EC
--- qtbase/src/network/ssl/qsslellipticcurve_openssl.cpp	2015-07-04 04:05:26.110568061 +0200
+++ qtbase/src/network/ssl/qsslellipticcurve_openssl.cpp	2015-07-04 04:06:01.709567956 +0200
@@ -76,7 +76,7 @@
 
     int nid = q_OBJ_sn2nid(curveNameLatin1.data());
 
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
+#if (OPENSSL_VERSION_NUMBER >= 0x10002000L) && !defined(LIBRESSL_VERSION_NUMBER)
     if (nid == 0 && q_SSLeay() >= 0x10002000L)
         nid = q_EC_curve_nist2nid(curveNameLatin1.data());
 #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L