summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2021-06-01 14:47:35 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2021-06-09 20:55:49 +0200
commit6998ed4c96cfd56d2265e4e748b30a95a2f3d723 (patch)
treec34193d1e5cc7a944b8c664f3ab68571cc6b5d41 /tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
parent5b78d7fdcf9b758f117eaa65dc5eeddd0d4557e0 (diff)
Introduce a mini-version of qsslsocket_openssl_symbols_p.h/.cpp
For auto-tests that were temporarily disabled. Similar to network-settings.h, header-only stuff. Fixes: QTBUG-92866 Fixes: QTBUG-92877 Change-Id: I15b5c0b41f0d8bfe59b09c844884ff6d99e6d41a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp')
-rw-r--r--tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp31
1 files changed, 17 insertions, 14 deletions
diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
index b35d6947df..cea49350f1 100644
--- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
+++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp
@@ -45,10 +45,9 @@
#include "private/qsslkey_p.h"
#define TEST_CRYPTO
#endif
- // TLSTODO: find another solution, for now this code
- // (OpenSSL specific) is a part of plugin, not in
- // QtNetwork anymore.
- // #include "private/qsslsocket_openssl_symbols_p.h"
+ #ifndef QT_NO_OPENSSL
+ #include "../shared/qopenssl_symbols.h"
+ #endif
#endif
#if QT_CONFIG(ssl)
@@ -119,6 +118,7 @@ private:
QVector<QString> unsupportedCurves;
bool isOpenSsl = false;
+ bool isOpenSslResolved = false;
bool isSecureTransport = false;
bool isSchannel = false;
};
@@ -151,8 +151,17 @@ tst_QSslKey::tst_QSslKey()
// Alas, we don't use network-private (and why?).
const auto backendName = QSslSocket::activeBackend();
isOpenSsl = backendName == QStringLiteral("openssl");
- if (!isOpenSsl)
+
+ if (isOpenSsl) {
+#if !defined(QT_NO_OPENSSL) && defined(QT_BUILD_INTERNAL)
+ isOpenSslResolved = qt_auto_test_resolve_OpenSSL_symbols();
+#else
+ isOpenSslResolved = false; // not 'unused variable' anymore.
+#endif
+ } else {
isSecureTransport = backendName == QStringLiteral("securetransport");
+ }
+
if (!isOpenSsl && !isSecureTransport)
isSchannel = backendName == QStringLiteral("schannel");
#else
@@ -289,13 +298,8 @@ void tst_QSslKey::constructorHandle()
{
#ifndef QT_BUILD_INTERNAL
QSKIP("This test requires -developer-build.");
-#endif // previously, else, see if 0 below.
-
-// TLSTODO: OpenSSL-specific code and symbols are now
-// part of 'openssl' plugin, not in QtNetwork anymore.
-// For now - disabling.
-#if 0
- if (!QSslSocket::supportsSsl())
+#else
+ if (!isOpenSslResolved)
return;
QFETCH(QString, absFilePath);
@@ -350,8 +354,7 @@ void tst_QSslKey::constructorHandle()
QCOMPARE(key.type(), type);
QCOMPARE(key.length(), length);
QCOMPARE(q_EVP_PKEY_cmp(origin, handle), 1);
-
-#endif // if 0
+#endif
}
#endif // !QT_NO_OPENSSL