blob: a1851fe927434a2e1a594a2c523cf7c9ac64a013 (
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 fb6302e47d32251815d1013e3fe18c22dfba28ac Mon Sep 17 00:00:00 2001
From: Martchus <martchus@gmx.net>
Date: Mon, 14 Jul 2025 23:40:15 +0200
Subject: [PATCH 17/20] 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 9ea73eb36c6..b9f8db3e9cd 100644
--- a/configure.cmake
+++ b/configure.cmake
@@ -1183,6 +1183,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
@@ -1443,6 +1449,7 @@ qt_configure_add_summary_entry(ARGS "Using vcpkg" TYPE "message" MESSAGE "${_vcp
qt_configure_add_summary_entry(ARGS "libudev")
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 1112f107757..62f4649e7d2 100644
--- a/src/network/CMakeLists.txt
+++ b/src/network/CMakeLists.txt
@@ -351,7 +351,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.52.0
|