blob: 19327aa8083059924fb10ebd9fe0214ec4bd7f0b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
From d088ff9b3b06e09f5e806027c2bf5bb8ce7bc9e5 Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Mon, 14 Jul 2025 23:40:15 +0200
Subject: [PATCH 16/24] Allow configuring use of OpenSSL in QPasswordDigestors
specifically
So far Qt Network always links against OpenSSL when the feature
`openssl-linked` is enabled to use it for QPasswordDigestors. This has the
disadvantage that OpenSSL is always used - even though a concrete
application using the build of Qt is otherwise only using the Schannel TLS
backend or no TLS backend at all.
With this change one can disable the use of OpenSSL for QPasswordDigestors
despite the use of `openssl-linked` with the feature flag
`openssl-password-digestor`. Then applications can still use the OpenSSL
TLS plugin (which is still linked against OpenSSL) but applications
preferring other TLS backends don't need to depend on OpenSSL.
Change-Id: I273fe5ad73db76c6432c39d0d09230d19a1f5608
---
configure.cmake | 7 +++++++
src/network/CMakeLists.txt | 2 +-
src/network/ssl/qpassworddigestor.cpp | 3 ++-
3 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/configure.cmake b/configure.cmake
index 668b4ac3413..55fb8b5d6b1 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1198,6 +1198,12 @@ qt_feature("openssl-linked" PUBLIC
ENABLE INPUT_openssl STREQUAL 'linked'
)
qt_feature_definition("openssl-linked" "QT_LINKED_OPENSSL")
+qt_feature("openssl-password-digestor" PUBLIC
+ LABEL "OpenSSL based QPasswordDigestors."
+ AUTODETECT ON
+ CONDITION QT_FEATURE_openssl_linked AND QT_FEATURE_opensslv30
+ PURPOSE "Uses OpenSSL based implementation of QPasswordDigestors."
+)
qt_feature("opensslv11" PUBLIC
LABEL "OpenSSL 1.1"
CONDITION TEST_opensslv11 OR TEST_opensslv11_headers
@@ -1512,6 +1518,7 @@ qt_configure_add_summary_entry(ARGS "libudev")
qt_configure_add_summary_entry(ARGS "liburing")
qt_configure_add_summary_entry(ARGS "openssl")
qt_configure_add_summary_entry(ARGS "openssl-linked")
+qt_configure_add_summary_entry(ARGS "openssl-password-digestor")
qt_configure_add_summary_entry(ARGS "opensslv11")
qt_configure_add_summary_entry(ARGS "opensslv30")
qt_configure_add_summary_entry(ARGS "system-zlib")
diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt
index e3c903b3641..dc78fb7bf88 100644
--- a/src/network/CMakeLists.txt
+++ b/src/network/CMakeLists.txt
@@ -356,7 +356,7 @@ qt_internal_extend_target(Network CONDITION QT_FEATURE_localserver AND WIN32
socket/qlocalsocket_win.cpp
)
-qt_internal_extend_target(Network CONDITION QT_FEATURE_openssl_linked AND QT_FEATURE_opensslv30
+qt_internal_extend_target(Network CONDITION QT_FEATURE_openssl_password_digestor AND QT_FEATURE_opensslv30
LIBRARIES
WrapOpenSSL::WrapOpenSSL
)
diff --git a/src/network/ssl/qpassworddigestor.cpp b/src/network/ssl/qpassworddigestor.cpp
index f2b896124a0..2835ef83ef2 100644
--- a/src/network/ssl/qpassworddigestor.cpp
+++ b/src/network/ssl/qpassworddigestor.cpp
@@ -9,11 +9,12 @@
#include <QtCore/QtEndian>
#include <QtCore/QList>
+#include "qconfig.h"
#include "qtcore-config_p.h"
#include <limits>
-#if QT_CONFIG(opensslv30) && QT_CONFIG(openssl_linked)
+#if QT_CONFIG(opensslv30) && QT_CONFIG(openssl_password_digestor)
#define USING_OPENSSL30
#include <openssl/core_names.h>
#include <openssl/kdf.h>
--
2.56.0
|