Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Nov 2018 20:29:01 +0000 (UTC)
From:      "Tobias C. Berner" <tcberner@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r485965 - in head/net/qt5-network: . files
Message-ID:  <201811262029.wAQKT1k9007257@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tcberner
Date: Mon Nov 26 20:29:01 2018
New Revision: 485965
URL: https://svnweb.freebsd.org/changeset/ports/485965

Log:
  net/qt5-network: fix build with LibreSSL
  
  PR:		228344
  Submitted by:	Walter Schwarzenfeld <w.schwarzenfeld@utanet.at>

Added:
  head/net/qt5-network/files/patch-qsslcontext_openssl.cpp   (contents, props changed)
Modified:
  head/net/qt5-network/Makefile
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h

Modified: head/net/qt5-network/Makefile
==============================================================================
--- head/net/qt5-network/Makefile	Mon Nov 26 19:01:17 2018	(r485964)
+++ head/net/qt5-network/Makefile	Mon Nov 26 20:29:01 2018	(r485965)
@@ -2,6 +2,7 @@
 
 PORTNAME=	network
 DISTVERSION=	${QT5_VERSION}
+PORTREVISION=	1
 CATEGORIES=	net ipv6
 PKGNAMEPREFIX=	qt5-
 

Added: head/net/qt5-network/files/patch-qsslcontext_openssl.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/qt5-network/files/patch-qsslcontext_openssl.cpp	Mon Nov 26 20:29:01 2018	(r485965)
@@ -0,0 +1,15 @@
+* 
+* Fix for libressl atter openssl111 API change
+*
+*
+--- src/network/ssl/qsslcontext_openssl.cpp.orig	2018-10-21 16:58:39 UTC
++++ src/network/ssl/qsslcontext_openssl.cpp
+@@ -248,7 +248,7 @@ void QSslContext::applyBackendConfig(QSs
+     if (sslContext->sslConfiguration.backendConfiguration().isEmpty())
+         return;
+ 
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+     if (QSslSocket::sslLibraryVersionNumber() >= 0x10002000L) {
+         QSharedPointer<SSL_CONF_CTX> cctx(q_SSL_CONF_CTX_new(), &q_SSL_CONF_CTX_free);
+         if (cctx) {

Modified: head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp
==============================================================================
--- head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp	Mon Nov 26 19:01:17 2018	(r485964)
+++ head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp	Mon Nov 26 20:29:01 2018	(r485965)
@@ -3,8 +3,13 @@
 * Prepend the path of the SSL libraries used for building so the same libraries are
 * found and loaded at runtime. Normal search finds base SSL libraries before ports.
 *
---- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2018-02-08 19:24:48.000000000 +0100
-+++ src/network/ssl/qsslsocket_openssl_symbols.cpp	2018-06-29 12:22:11.265885000 +0200
+* = =  = = = = = = = = = = = = = = = = = = = =
+*
+* Fix for libressl atter openssl111 API change
+*
+*
+--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2018-10-21 15:55:52 UTC
++++ src/network/ssl/qsslsocket_openssl_symbols.cpp
 @@ -150,6 +150,14 @@ DEFINEFUNC2(int, BN_is_word, BIGNUM *a, 
  DEFINEFUNC(int, EVP_CIPHER_CTX_reset, EVP_CIPHER_CTX *c, c, return 0, return)
  DEFINEFUNC(int, EVP_PKEY_base_id, EVP_PKEY *a, a, return NID_undef, return)
@@ -38,7 +43,16 @@
  DEFINEFUNC(EVP_PKEY *, X509_get_pubkey, X509 *a, a, return 0, return)
  DEFINEFUNC2(void, X509_STORE_set_verify_cb, X509_STORE *a, a, X509_STORE_CTX_verify_cb verify_cb, verify_cb, return, DUMMYARG)
  DEFINEFUNC(STACK_OF(X509) *, X509_STORE_CTX_get0_chain, X509_STORE_CTX *a, a, return 0, return)
-@@ -524,6 +535,9 @@ DEFINEFUNC(void, EC_KEY_free, EC_KEY *ec
+@@ -406,7 +417,7 @@ DEFINEFUNC2(int, SSL_CTX_use_PrivateKey,
+ DEFINEFUNC2(int, SSL_CTX_use_RSAPrivateKey, SSL_CTX *a, a, RSA *b, b, return -1, return)
+ DEFINEFUNC3(int, SSL_CTX_use_PrivateKey_file, SSL_CTX *a, a, const char *b, b, int c, c, return -1, return)
+ DEFINEFUNC(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *a, a, return 0, return)
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ DEFINEFUNC(SSL_CONF_CTX *, SSL_CONF_CTX_new, DUMMYARG, DUMMYARG, return 0, return);
+ DEFINEFUNC(void, SSL_CONF_CTX_free, SSL_CONF_CTX *a, a, return ,return);
+ DEFINEFUNC2(void, SSL_CONF_CTX_set_ssl_ctx, SSL_CONF_CTX *a, a, SSL_CTX *b, b, return, return);
+@@ -537,6 +548,9 @@ DEFINEFUNC(void, EC_KEY_free, EC_KEY *ec
  DEFINEFUNC2(size_t, EC_get_builtin_curves, EC_builtin_curve * r, r, size_t nitems, nitems, return 0, return)
  #if OPENSSL_VERSION_NUMBER >= 0x10002000L
  DEFINEFUNC(int, EC_curve_nist2nid, const char *name, name, return 0, return)
@@ -48,7 +62,7 @@
  #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
  #endif // OPENSSL_NO_EC
  
-@@ -769,8 +783,8 @@ static QPair<QLibrary*, QLibrary*> loadO
+@@ -782,8 +796,8 @@ static QPair<QLibrary*, QLibrary*> loadO
  #endif
  #if defined(SHLIB_VERSION_NUMBER) && !defined(Q_OS_QNX) // on QNX, the libs are always libssl.so and libcrypto.so
      // first attempt: the canonical name is libssl.so.<SHLIB_VERSION_NUMBER>
@@ -59,7 +73,7 @@
      if (libcrypto->load() && libssl->load()) {
          // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found
          return pair;
-@@ -787,8 +801,8 @@ static QPair<QLibrary*, QLibrary*> loadO
+@@ -800,8 +814,8 @@ static QPair<QLibrary*, QLibrary*> loadO
      //  macOS's /usr/lib/libssl.dylib, /usr/lib/libcrypto.dylib will be picked up in the third
      //    attempt, _after_ <bundle>/Contents/Frameworks has been searched.
      //  iOS does not ship a system libssl.dylib, libcrypto.dylib in the first place.
@@ -70,7 +84,7 @@
      if (libcrypto->load() && libssl->load()) {
          // libssl.so.0 and libcrypto.so.0 found
          return pair;
-@@ -872,17 +886,30 @@ bool q_resolveOpenSslSymbols()
+@@ -885,17 +899,30 @@ bool q_resolveOpenSslSymbols()
      RESOLVEFUNC(EVP_CIPHER_CTX_reset)
      RESOLVEFUNC(EVP_PKEY_base_id)
      RESOLVEFUNC(RSA_bits)
@@ -102,7 +116,7 @@
      RESOLVEFUNC(SSL_get_session)
      RESOLVEFUNC(CRYPTO_get_ex_new_index)
      RESOLVEFUNC(TLS_method)
-@@ -891,7 +918,9 @@ bool q_resolveOpenSslSymbols()
+@@ -904,7 +931,9 @@ bool q_resolveOpenSslSymbols()
      RESOLVEFUNC(X509_STORE_CTX_get0_chain)
      RESOLVEFUNC(X509_getm_notBefore)
      RESOLVEFUNC(X509_getm_notAfter)
@@ -112,7 +126,7 @@
      RESOLVEFUNC(X509_get_pubkey)
      RESOLVEFUNC(X509_STORE_set_verify_cb)
      RESOLVEFUNC(CRYPTO_free)
-@@ -908,7 +937,9 @@ bool q_resolveOpenSslSymbols()
+@@ -921,7 +950,9 @@ bool q_resolveOpenSslSymbols()
  
      RESOLVEFUNC(SSL_SESSION_get_ticket_lifetime_hint)
      RESOLVEFUNC(DH_bits)
@@ -122,7 +136,7 @@
  
  #else // !opensslv11
  
-@@ -979,10 +1010,9 @@ bool q_resolveOpenSslSymbols()
+@@ -992,10 +1023,9 @@ bool q_resolveOpenSslSymbols()
      RESOLVEFUNC(OPENSSL_add_all_algorithms_conf)
      RESOLVEFUNC(SSLeay)
  
@@ -134,7 +148,7 @@
          delete libs.first;
          delete libs.second;
          qCWarning(lcSsl, "Incompatible version of OpenSSL");
-@@ -994,8 +1024,12 @@ bool q_resolveOpenSslSymbols()
+@@ -1007,8 +1037,12 @@ bool q_resolveOpenSslSymbols()
  
  #ifndef OPENSSL_NO_EC
  #if OPENSSL_VERSION_NUMBER >= 0x10002000L
@@ -148,3 +162,12 @@
  #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
  #endif // OPENSSL_NO_EC
  
+@@ -1122,7 +1156,7 @@ bool q_resolveOpenSslSymbols()
+     RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey)
+     RESOLVEFUNC(SSL_CTX_use_PrivateKey_file)
+     RESOLVEFUNC(SSL_CTX_get_cert_store);
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+     RESOLVEFUNC(SSL_CONF_CTX_new);
+     RESOLVEFUNC(SSL_CONF_CTX_free);
+     RESOLVEFUNC(SSL_CONF_CTX_set_ssl_ctx);

Modified: head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h
==============================================================================
--- head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h	Mon Nov 26 19:01:17 2018	(r485964)
+++ head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h	Mon Nov 26 20:29:01 2018	(r485965)
@@ -1,7 +1,34 @@
 Boilerplate for SSL_CTX_set1_groups() used in qsslcontext_openssl.cpp.
---- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig	2018-02-08 18:24:48 UTC
+*
+* Fix for libressl atter openssl111 API change
+* Definitions for TLS_VERSIONS needed for  qsslcontext_openssl11.cpp (QSslContext::initSslContext)
+*
+--- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig	2018-10-21 17:04:11 UTC
 +++ src/network/ssl/qsslsocket_openssl_symbols_p.h
-@@ -454,6 +454,9 @@ void q_EC_KEY_free(EC_KEY *ecdh);
+@@ -74,6 +74,13 @@
+ 
+ QT_BEGIN_NAMESPACE
+ 
++#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x20700000L
++# define TLS1_2_VERSION 0x0303
++# define TLS_MAX_VERSION TLS1_2_VERSION
++# define TLS_ANY_VERSION 0x10000
++#endif
++
++
+ #define DUMMYARG
+ 
+ #if !defined QT_LINKED_OPENSSL
+@@ -356,7 +363,7 @@ int q_SSL_CTX_use_PrivateKey(SSL_CTX *a,
+ int q_SSL_CTX_use_RSAPrivateKey(SSL_CTX *a, RSA *b);
+ int q_SSL_CTX_use_PrivateKey_file(SSL_CTX *a, const char *b, int c);
+ X509_STORE *q_SSL_CTX_get_cert_store(const SSL_CTX *a);
+-#if OPENSSL_VERSION_NUMBER >= 0x10002000L
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CONF_CTX *q_SSL_CONF_CTX_new();
+ void q_SSL_CONF_CTX_free(SSL_CONF_CTX *a);
+ void q_SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *a, SSL_CTX *b);
+@@ -468,6 +475,9 @@ void q_EC_KEY_free(EC_KEY *ecdh);
  size_t q_EC_get_builtin_curves(EC_builtin_curve *r, size_t nitems);
  #if OPENSSL_VERSION_NUMBER >= 0x10002000L
  int q_EC_curve_nist2nid(const char *name);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201811262029.wAQKT1k9007257>