From 6998ed4c96cfd56d2265e4e748b30a95a2f3d723 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 1 Jun 2021 14:47:35 +0200 Subject: Introduce a mini-version of qsslsocket_openssl_symbols_p.h/.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: MÃ¥rten Nordheim --- tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp | 31 ++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp') 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 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 -- cgit v1.2.3