FreeBSD Bugzilla – Attachment 180112 Details for
Bug 216781
net/qt5-network: fix build with libressl-devel
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix qt5-network with libressl
qt5patch (text/plain), 9.22 KB, created by
Matthew Rezny
on 2017-02-18 16:25:00 UTC
(
hide
)
Description:
fix qt5-network with libressl
Filename:
MIME Type:
Creator:
Matthew Rezny
Created:
2017-02-18 16:25:00 UTC
Size:
9.22 KB
patch
obsolete
>Index: net/qt5-network/Makefile >=================================================================== >--- net/qt5-network/Makefile (revision 434282) >+++ net/qt5-network/Makefile (working copy) >@@ -26,7 +26,8 @@ > > post-patch: > @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ >- ${BUILD_WRKSRC}/ssl/qsslsocket_openssl.cpp \ >+ ${BUILD_WRKSRC}/ssl/qsslsocket_openssl.cpp >+ @${REINPLACE_CMD} -e 's|%%OPENSSLLIB%%|${OPENSSLLIB}|g' \ > ${BUILD_WRKSRC}/ssl/qsslsocket_openssl_symbols.cpp > > post-build: >Index: net/qt5-network/files/patch-src_network_ssl_qsslcontext__openssl.cpp >=================================================================== >--- net/qt5-network/files/patch-src_network_ssl_qsslcontext__openssl.cpp (revision 434282) >+++ net/qt5-network/files/patch-src_network_ssl_qsslcontext__openssl.cpp (working copy) >@@ -1,29 +1,37 @@ >-Obtained from: https://github.com/libressl-portable/openbsd/issues/33 >- >-From 81494e67eccba04fc3fe554d76a9ca6fe7f2250e Mon Sep 17 00:00:00 2001 >-From: hasufell <hasufell@gentoo.org> >-Date: Sat, 10 Oct 2015 01:15:01 +0200 >-Subject: [PATCH] Fix compilation with libressl >- >-By additionally checking for defined(SSL_CTRL_SET_CURVES), which >-is defined in openssl, but not in libressl. >---- src/network/ssl/qsslcontext_openssl.cpp.orig 2015-10-13 04:35:28 UTC >+--- src/network/ssl/qsslcontext_openssl.cpp.orig 2016-09-16 05:49:42 UTC > +++ src/network/ssl/qsslcontext_openssl.cpp >-@@ -338,7 +338,7 @@ init_context: >- >- 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(SSL_CTRL_SET_CURVES) && !defined(OPENSSL_NO_EC) >+@@ -343,15 +343,25 @@ init_context: >+ #if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) > // Set the curves to be used > if (q_SSLeay() >= 0x10002000L) { >- // SSL_CTX_ctrl wants a non-const pointer as last argument, >-@@ -352,7 +352,7 @@ init_context: >- return sslContext; >+- // SSL_CTX_ctrl wants a non-const pointer as last argument, >+- // but let's avoid a copy into a temporary array >+- if (!q_SSL_CTX_ctrl(sslContext->ctx, >+- SSL_CTRL_SET_CURVES, >+- qcurves.size(), >+- const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())))) { >+- sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl()); >+- sslContext->errorCode = QSslError::UnspecifiedError; >+- return sslContext; >++ switch (q_SSL_CTX_set1_curves(sslContext->ctx, >++ const_cast<int *>(reinterpret_cast<const int *>(qcurves.data())), >++ qcurves.size())) { >++ case 1: >++ default: >++ break; >++ case 0: >++ sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl()); >++ sslContext->errorCode = QSslError::UnspecifiedError; >++ return sslContext; >++ case -1: >++ if (q_SSL_CTX_set1_groups(sslContext->ctx, >++ reinterpret_cast<const int *>(qcurves.data()), >++ qcurves.size()) < 1) { >++ sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocketBackendPrivate::getErrorsFromOpenSsl()); >++ sslContext->errorCode = QSslError::UnspecifiedError; >++ return sslContext; >++ } >++ break; > } > } else >--#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) >-+#endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && defined(SSL_CTRL_SET_CURVES) && !defined(OPENSSL_NO_EC) >- { >- // specific curves requested, but not possible to set -> error >- sslContext->errorStr = msgErrorSettingEllipticCurves(QSslSocket::tr("OpenSSL version too old, need at least v1.0.2")); >+ #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(OPENSSL_NO_EC) >Index: net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp >=================================================================== >--- net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp (revision 434282) >+++ net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols.cpp (working copy) >@@ -1,24 +1,46 @@ >---- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig 2015-02-17 04:56:38 UTC >+--- src/network/ssl/qsslsocket_openssl_symbols.cpp.orig 2016-09-16 05:49:42 UTC > +++ src/network/ssl/qsslsocket_openssl_symbols.cpp >-@@ -611,8 +611,8 @@ static QPair<QLibrary*, QLibrary*> loadO >+@@ -424,6 +424,8 @@ 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) >++DEFINEFUNC3(int, SSL_CTX_set1_curves, SSL_CTX *a, a, int *b, b, int c, c, return -1, return) >++DEFINEFUNC3(int, SSL_CTX_set1_groups, SSL_CTX *a, a, const int *b, b, size_t c, c, return -1, return) >+ #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L >+ #endif // OPENSSL_NO_EC >+ >+@@ -652,8 +654,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> > - libssl->setFileNameAndVersion(QLatin1String("ssl"), QLatin1String(SHLIB_VERSION_NUMBER)); > - libcrypto->setFileNameAndVersion(QLatin1String("crypto"), QLatin1String(SHLIB_VERSION_NUMBER)); >-+ libssl->setFileNameAndVersion(QLatin1String("/usr/local/libssl"), QLatin1String(SHLIB_VERSION_NUMBER)); >-+ libcrypto->setFileNameAndVersion(QLatin1String("/usr/local/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER)); >++ libssl->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libssl"), QLatin1String(SHLIB_VERSION_NUMBER)); >++ libcrypto->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libcrypto"), QLatin1String(SHLIB_VERSION_NUMBER)); > if (libcrypto->load() && libssl->load()) { > // libssl.so.<SHLIB_VERSION_NUMBER> and libcrypto.so.<SHLIB_VERSION_NUMBER> found > return pair; >-@@ -629,8 +629,8 @@ static QPair<QLibrary*, QLibrary*> loadO >+@@ -670,8 +672,8 @@ static QPair<QLibrary*, QLibrary*> loadO > // OS X'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. > - libssl->setFileNameAndVersion(QLatin1String("ssl"), -1); > - libcrypto->setFileNameAndVersion(QLatin1String("crypto"), -1); >-+ libssl->setFileNameAndVersion(QLatin1String("/usr/local/lib/libssl"), -1); >-+ libcrypto->setFileNameAndVersion(QLatin1String("/usr/local/lib/libcrypto"), -1); >++ libssl->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libssl"), -1); >++ libcrypto->setFileNameAndVersion(QLatin1String("%%OPENSSLLIB%%/libcrypto"), -1); > if (libcrypto->load() && libssl->load()) { > // libssl.so.0 and libcrypto.so.0 found > return pair; >+@@ -976,8 +978,11 @@ bool q_resolveOpenSslSymbols() >+ RESOLVEFUNC(EC_KEY_free) >+ RESOLVEFUNC(EC_get_builtin_curves) >+ #if OPENSSL_VERSION_NUMBER >= 0x10002000L >+- if (q_SSLeay() >= 0x10002000L) >++ if (q_SSLeay() >= 0x10002000L) { >+ RESOLVEFUNC(EC_curve_nist2nid) >++ RESOLVEFUNC(SSL_CTX_set1_curves) >++ RESOLVEFUNC(SSL_CTX_set1_groups) >++ } >+ #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L >+ #endif // OPENSSL_NO_EC >+ RESOLVEFUNC(PKCS12_parse) >Index: net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h >=================================================================== >--- net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h (nonexistent) >+++ net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h (working copy) >@@ -0,0 +1,11 @@ >+--- src/network/ssl/qsslsocket_openssl_symbols_p.h.orig 2016-09-16 05:49:42 UTC >++++ src/network/ssl/qsslsocket_openssl_symbols_p.h >+@@ -481,6 +481,8 @@ 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); >++int q_SSL_CTX_set1_curves(SSL_CTX *a, int *b, int c); >++int q_SSL_CTX_set1_groups(SSL_CTX *a, const int *b, size_t c); >+ #endif // OPENSSL_VERSION_NUMBER >= 0x10002000L >+ #endif // OPENSSL_NO_EC >+ > >Property changes on: net/qt5-network/files/patch-src_network_ssl_qsslsocket__openssl__symbols__p.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 216781
:
179597
|
180112
|
180114
|
180133