View | Details | Raw Unified | Return to bug 216781 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-src_network_ssl_qsslcontext__openssl.cpp (-14 / +5 lines)
Lines 1-29 Link Here
1
Obtained from: https://github.com/libressl-portable/openbsd/issues/33
1
--- src/network/ssl/qsslcontext_openssl.cpp.orig	2016-09-16 05:49:42 UTC
2
3
From 81494e67eccba04fc3fe554d76a9ca6fe7f2250e Mon Sep 17 00:00:00 2001
4
From: hasufell <hasufell@gentoo.org>
5
Date: Sat, 10 Oct 2015 01:15:01 +0200
6
Subject: [PATCH] Fix compilation with libressl
7
8
By additionally checking for defined(SSL_CTRL_SET_CURVES), which
9
is defined in openssl, but not in libressl.
10
--- src/network/ssl/qsslcontext_openssl.cpp.orig	2015-10-13 04:35:28 UTC
11
+++ src/network/ssl/qsslcontext_openssl.cpp
2
+++ src/network/ssl/qsslcontext_openssl.cpp
12
@@ -338,7 +338,7 @@ init_context:
3
@@ -340,7 +341,7 @@ init_context:
13
 
4
 
14
     const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
5
     const QVector<QSslEllipticCurve> qcurves = sslContext->sslConfiguration.ellipticCurves();
15
     if (!qcurves.isEmpty()) {
6
     if (!qcurves.isEmpty()) {
16
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
7
-#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
17
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && defined(SSL_CTRL_SET_CURVES) && !defined(OPENSSL_NO_EC)
8
+#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(LIBRESSL_VERSION_NUMBER)
18
         // Set the curves to be used
9
         // Set the curves to be used
19
         if (q_SSLeay() >= 0x10002000L) {
10
         if (q_SSLeay() >= 0x10002000L) {
20
             // SSL_CTX_ctrl wants a non-const pointer as last argument,
11
             // SSL_CTX_ctrl wants a non-const pointer as last argument,
21
@@ -352,7 +352,7 @@ init_context:
12
@@ -354,7 +355,7 @@ init_context:
22
                 return sslContext;
13
                 return sslContext;
23
             }
14
             }
24
         } else
15
         } else
25
-#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
16
-#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC)
26
+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && defined(SSL_CTRL_SET_CURVES) && !defined(OPENSSL_NO_EC)
17
+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(LIBRESSL_VERSION_NUMBER)
27
         {
18
         {
28
             // specific curves requested, but not possible to set -> error
19
             // specific curves requested, but not possible to set -> error
29
             sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));
20
             sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2"));

Return to bug 216781