net/qt5-network: fix build with LibreSSL 3.4.0

"Upstream has erroneous #ifdefs which will lead to a runtime abort
if both TLS1_3_VERSION and OPENSSL_NO_PSK are defined. Adjust
them."

Obtained from:
21d28f2317

Approved by: fluffy (mentor, kde)
Differential Revision: https://reviews.freebsd.org/D32286
This commit is contained in:
Charlie Li 2021-10-04 02:22:15 -04:00
parent 5b57210d0d
commit 6953f406af
No known key found for this signature in database
GPG Key ID: FEB7852BE29B3E87
1 changed files with 23 additions and 2 deletions

View File

@ -1,7 +1,28 @@
Patch from Gentoo: https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-qt/qtnetwork/files/qtnetwork-5.15.1-libressl.patch
--- src/network/ssl/qsslsocket_openssl.cpp.orig 2020-09-02 10:15:07 UTC
--- src/network/ssl/qsslsocket_openssl.cpp.orig 2020-10-27 08:02:11 UTC
+++ src/network/ssl/qsslsocket_openssl.cpp
@@ -653,7 +653,7 @@ bool QSslSocketBackendPrivate::initSslContext()
@@ -238,7 +238,11 @@ static int q_ssl_psk_use_session_callback(SSL *ssl, co
return 1; // need to return 1 or else "the connection setup fails."
}
+#endif // TLS1_3_VERSION
+#endif // !OPENSSL_NO_PSK
+
+#ifdef TLS1_3_VERSION
int q_ssl_sess_set_new_cb(SSL *ssl, SSL_SESSION *session)
{
if (!ssl) {
@@ -256,8 +260,6 @@ int q_ssl_sess_set_new_cb(SSL *ssl, SSL_SESSION *sessi
}
#endif // TLS1_3_VERSION
-#endif // !OPENSSL_NO_PSK
-
#if QT_CONFIG(ocsp)
int qt_OCSP_status_server_callback(SSL *ssl, void *ocspRequest)
@@ -653,7 +655,7 @@ bool QSslSocketBackendPrivate::initSslContext()
else if (mode == QSslSocket::SslServerMode)
q_SSL_set_psk_server_callback(ssl, &q_ssl_psk_server_callback);