summaryrefslogtreecommitdiffstats
path: root/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch
diff options
context:
space:
mode:
authorScott Murray <scott.murray@konsulko.com>2022-08-14 15:58:44 -0400
committerScott Murray <scott.murray@konsulko.com>2022-08-22 13:32:09 +0000
commit8ce71214c1935c2160d139140972f328afacabee (patch)
tree77f093aa912c1486e232ac70610744baacca0583 /meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch
parent3ff972228b08c37adf41b760c2bbc5313b90715f (diff)
qtbase: Add backported patches for OpenSSL 3 support
To make QSslSocket work when building with OpenSSL 3.x, add two backported patches pulled from the v5.15.3-lts-lgpl branch of the KDE repo: https://invent.kde.org/qt/qt/qtbase This appears to be the minimal fix for e.g. QtLocation's SSL usage. For more information on the KDE Qt5 patch collection, see: https://community.kde.org/Qt5PatchCollection Bug-AGL: SPEC-4395 Signed-off-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I0bc3fe7c0726aaea71a2c162db040e57ac92a9db Reviewed-on: https://gerrit.automotivelinux.org/gerrit/c/AGL/meta-agl/+/27902 Tested-by: Jenkins Job builder account ci-image-build: Jenkins Job builder account ci-image-boot-test: Jenkins Job builder account
Diffstat (limited to 'meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch')
-rw-r--r--meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch
new file mode 100644
index 000000000..ba3c2be42
--- /dev/null
+++ b/meta-agl-core/dynamic-layers/meta-qt5/recipes-qt/qt5/qtbase/0001-Don-t-use-a-deprecated-function-if-built-linked-with.patch
@@ -0,0 +1,84 @@
+From bed8f42232886b3b738cb4d4ff77846283c59665 Mon Sep 17 00:00:00 2001
+From: Timur Pocheptsov <timur.pocheptsov@qt.io>
+Date: Mon, 12 Jul 2021 12:38:14 +0200
+Subject: [PATCH] Don't use a deprecated function if built/linked with OpenSSL
+ v3
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+SSL_get_peer_certificate was deprecated in OpenSSL v3 and can be 'compiled-out'
+using OPENSSL_API_COMPAT. Use SSL_get1_peer_certificate instead.
+
+Pick-to: 6.2
+Task-number: QTBUG-94596
+Change-Id: Iedb2e06e673e981cab79d4bf0147ac6f5f90089a
+Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
+(cherry picked from commit ae6590e360fbb04d93940b2651f70df44a28943e)
+---
+ src/network/ssl/qsslsocket_openssl_symbols.cpp | 12 ++++++++++++
+ src/network/ssl/qsslsocket_openssl_symbols_p.h | 9 ++++++++-
+ 2 files changed, 20 insertions(+), 1 deletion(-)
+
+diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp
+index 81caef3d8f..f343349e2c 100644
+--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
++++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
+@@ -368,7 +368,13 @@ DEFINEFUNC(const SSL_CIPHER *, SSL_get_current_cipher, SSL *a, a, return nullptr
+ DEFINEFUNC(int, SSL_version, const SSL *a, a, return 0, return)
+ DEFINEFUNC2(int, SSL_get_error, SSL *a, a, int b, b, return -1, return)
+ DEFINEFUNC(STACK_OF(X509) *, SSL_get_peer_cert_chain, SSL *a, a, return nullptr, return)
++
++#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
++DEFINEFUNC(X509 *, SSL_get1_peer_certificate, SSL *a, a, return nullptr, return)
++#else
+ DEFINEFUNC(X509 *, SSL_get_peer_certificate, SSL *a, a, return nullptr, return)
++#endif // OPENSSL_VERSION_MAJOR >= 3
++
+ DEFINEFUNC(long, SSL_get_verify_result, const SSL *a, a, return -1, return)
+ DEFINEFUNC(SSL *, SSL_new, SSL_CTX *a, a, return nullptr, return)
+ DEFINEFUNC(SSL_CTX *, SSL_get_SSL_CTX, SSL *a, a, return nullptr, return)
+@@ -1075,7 +1081,13 @@ bool q_resolveOpenSslSymbols()
+ RESOLVEFUNC(SSL_version)
+ RESOLVEFUNC(SSL_get_error)
+ RESOLVEFUNC(SSL_get_peer_cert_chain)
++
++#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
++ RESOLVEFUNC(SSL_get1_peer_certificate)
++#else
+ RESOLVEFUNC(SSL_get_peer_certificate)
++#endif // OPENSSL_VERSION_MAJOR >= 3
++
+ RESOLVEFUNC(SSL_get_verify_result)
+ RESOLVEFUNC(SSL_new)
+ RESOLVEFUNC(SSL_get_SSL_CTX)
+diff --git a/src/network/ssl/qsslsocket_openssl_symbols_p.h b/src/network/ssl/qsslsocket_openssl_symbols_p.h
+index b363e77f48..000134b671 100644
+--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
++++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
+@@ -509,7 +509,6 @@ const SSL_CIPHER *q_SSL_get_current_cipher(SSL *a);
+ int q_SSL_version(const SSL *a);
+ int q_SSL_get_error(SSL *a, int b);
+ STACK_OF(X509) *q_SSL_get_peer_cert_chain(SSL *a);
+-X509 *q_SSL_get_peer_certificate(SSL *a);
+ long q_SSL_get_verify_result(const SSL *a);
+ SSL *q_SSL_new(SSL_CTX *a);
+ SSL_CTX *q_SSL_get_SSL_CTX(SSL *a);
+@@ -748,6 +747,14 @@ void *q_CRYPTO_malloc(size_t num, const char *file, int line);
+ int q_SSL_CTX_get_security_level(const SSL_CTX *ctx);
+ void q_SSL_CTX_set_security_level(SSL_CTX *ctx, int level);
+
++// Here we have the ones that make difference between OpenSSL pre/post v3:
++#if defined(OPENSSL_VERSION_MAJOR) && OPENSSL_VERSION_MAJOR >= 3
++X509 *q_SSL_get1_peer_certificate(SSL *a);
++#define q_SSL_get_peer_certificate q_SSL_get1_peer_certificate
++#else
++X509 *q_SSL_get_peer_certificate(SSL *a);
++#endif // OPENSSL_VERSION_MAJOR >= 3
++
+ QT_END_NAMESPACE
+
+ #endif
+--
+2.35.3
+