Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Jan 2018 11:56:14 +0000 (UTC)
From:      Ben Woods <woodsb02@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r459510 - in head/net/qt5-network: . files
Message-ID:  <201801201156.w0KBuEMW084929@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: woodsb02
Date: Sat Jan 20 11:56:14 2018
New Revision: 459510
URL: https://svnweb.freebsd.org/changeset/ports/459510

Log:
  net/qt5-network: Fix SSL runtime detection code with LibreSSL
  
  Patch taken from OpenBSD ports:
    http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/x11/qt5/qtbase/patches/patch-src_network_ssl_qsslsocket_openssl_symbols_cpp.diff?r1=1.2&r2=1.3
    http://cvsweb.openbsd.org/cgi-bin/cvsweb/ports/x11/qt5/qtbase/patches/patch-src_network_ssl_qsslsocket_openssl_symbols_p_h.diff?r1=1.2&r2=1.3
  
  PR:		225332
  Approved by:	tcberner
  Obtained from:	OpenBSD ports

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	Sat Jan 20 10:25:50 2018	(r459509)
+++ head/net/qt5-network/Makefile	Sat Jan 20 11:56:14 2018	(r459510)
@@ -2,6 +2,7 @@
 
 PORTNAME=	network
 DISTVERSION=	${QT5_VERSION}
+PORTREVISION=	1
 CATEGORIES=	net ipv6
 PKGNAMEPREFIX=	qt5-
 

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	Sat Jan 20 10:25:50 2018	(r459509)
+++ head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp	Sat Jan 20 11:56:14 2018	(r459510)
@@ -3,9 +3,18 @@
 * 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	2016-12-01 08:17:04 UTC
+--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig	2017-11-16 05:15:28 UTC
 +++ src/network/ssl/qsslsocket_openssl_symbols.cpp
-@@ -430,6 +430,7 @@ DEFINEFUNC(void, EC_KEY_free, EC_KEY *ec
+@@ -151,7 +151,7 @@ DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int 
+ DEFINEFUNC(BIO_METHOD *, BIO_s_mem, void, DUMMYARG, return 0, return)
+ DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return)
+ DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return)
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if !defined(BN_is_word)
+ DEFINEFUNC2(int, BN_is_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return)
+ #endif
+ DEFINEFUNC2(BN_ULONG, BN_mod_word, const BIGNUM *a, a, BN_ULONG w, w, return static_cast<BN_ULONG>(-1), return)
+@@ -453,6 +453,7 @@ DEFINEFUNC(void, EC_KEY_free, EC_KEY *ecdh, ecdh, retu
  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)
@@ -35,7 +44,16 @@
      if (libcrypto->load() && libssl->load()) {
          // libssl.so.0 and libcrypto.so.0 found
          return pair;
-@@ -982,8 +983,10 @@ bool q_resolveOpenSslSymbols()
+@@ -790,7 +791,7 @@ bool q_resolveOpenSslSymbols()
+     RESOLVEFUNC(EC_GROUP_get_degree)
+ #endif
+     RESOLVEFUNC(BN_num_bits)
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if !defined(BN_is_word)
+     RESOLVEFUNC(BN_is_word)
+ #endif
+     RESOLVEFUNC(BN_mod_word)
+@@ -1020,8 +1021,10 @@ bool q_resolveOpenSslSymbols()
      RESOLVEFUNC(EC_KEY_free)
      RESOLVEFUNC(EC_get_builtin_curves)
  #if OPENSSL_VERSION_NUMBER >= 0x10002000L
@@ -47,3 +65,15 @@
  #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L
  #endif // OPENSSL_NO_EC
      RESOLVEFUNC(PKCS12_parse)
+@@ -1030,10 +1033,9 @@ bool q_resolveOpenSslSymbols()
+ 
+     delete libs.first;
+     delete libs.second;
+-    if (!_q_SSLeay || q_SSLeay() >= 0x10100000L) {
++    if (!_q_SSLeay) {
+         // OpenSSL 1.1 deprecated and removed SSLeay. We consider a failure to
+         // resolve this symbol as a failure to resolve symbols.
+-        // The right operand of '||' above ... a bit of paranoia.
+         qCWarning(lcSsl, "Incompatible version of OpenSSL");
+         return false;
+     }

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	Sat Jan 20 10:25:50 2018	(r459509)
+++ head/net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h	Sat Jan 20 11:56:14 2018	(r459510)
@@ -2,9 +2,18 @@
 *
 * check macro is defined instead of version, LibreSSL < 2.5 doesn't have SSL_CTRL_GET_SERVER_TMP_KEY
 *
---- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig	2016-12-01 08:17:04 UTC
+--- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig	2017-11-16 05:15:28 UTC
 +++ src/network/ssl/qsslsocket_openssl_symbols_p.h
-@@ -487,11 +487,12 @@ void q_EC_KEY_free(EC_KEY *ecdh);
+@@ -228,7 +228,7 @@ int q_BIO_read(BIO *a, void *b, int c);
+ Q_AUTOTEST_EXPORT BIO_METHOD *q_BIO_s_mem();
+ Q_AUTOTEST_EXPORT int q_BIO_write(BIO *a, const void *b, int c);
+ int q_BN_num_bits(const BIGNUM *a);
+-#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++#if !defined(BN_is_word)
+ int q_BN_is_word(BIGNUM *a, BN_ULONG w);
+ #else
+ // BN_is_word is implemented purely as a
+@@ -511,11 +511,12 @@ 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?201801201156.w0KBuEMW084929>