diff options
Diffstat (limited to 'tests/auto/network/ssl')
-rw-r--r-- | tests/auto/network/ssl/CMakeLists.txt | 38 | ||||
-rw-r--r-- | tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp | 10 | ||||
-rw-r--r-- | tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp | 14 | ||||
-rw-r--r-- | tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp | 54 | ||||
-rw-r--r-- | tests/auto/network/ssl/ssl.pro | 4 |
5 files changed, 24 insertions, 96 deletions
diff --git a/tests/auto/network/ssl/CMakeLists.txt b/tests/auto/network/ssl/CMakeLists.txt index c10cfabbf4..6d4dc15cc8 100644 --- a/tests/auto/network/ssl/CMakeLists.txt +++ b/tests/auto/network/ssl/CMakeLists.txt @@ -6,31 +6,17 @@ add_subdirectory(qsslcipher) add_subdirectory(qsslellipticcurve) add_subdirectory(qsslerror) add_subdirectory(qsslkey) - -if(QT_FEATURE_ssl) - - if(QT_FEATURE_private_tests) - add_subdirectory(qsslsocket) - if(NOT WINRT) - add_subdirectory(qsslsocket_onDemandCertificates_member) - add_subdirectory(qsslsocket_onDemandCertificates_static) - endif() - - if(QT_FEATURE_dtls) - add_subdirectory(qdtlscookie) - add_subdirectory(qdtls) - endif() - - if(QT_FEATURE_ocsp) - add_subdirectory(qocsp) - endif() - endif() +if(QT_FEATURE_private_tests AND QT_FEATURE_ssl) + add_subdirectory(qsslsocket) + add_subdirectory(qsslsocket_onDemandCertificates_member) + add_subdirectory(qsslsocket_onDemandCertificates_static) + add_subdirectory(qasn1element) + add_subdirectory(qssldiffiehellmanparameters) endif() - -if(QT_FEATURE_ssl) - - if(QT_FEATURE_private_tests) - add_subdirectory(qasn1element) - add_subdirectory(qssldiffiehellmanparameters) - endif() +if(QT_FEATURE_dtls AND QT_FEATURE_private_tests AND QT_FEATURE_ssl) + add_subdirectory(qdtlscookie) + add_subdirectory(qdtls) +endif() +if(QT_FEATURE_ocsp AND QT_FEATURE_private_tests AND QT_FEATURE_ssl) + add_subdirectory(qocsp) endif() diff --git a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp index 0611deb184..69a90c9c83 100644 --- a/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp +++ b/tests/auto/network/ssl/qsslcertificate/tst_qsslcertificate.cpp @@ -819,7 +819,7 @@ void tst_QSslCertificate::task256066toPem() void tst_QSslCertificate::nulInCN() { -#if QT_CONFIG(securetransport) || defined(Q_OS_WINRT) || QT_CONFIG(schannel) +#if QT_CONFIG(securetransport) || QT_CONFIG(schannel) QSKIP("Generic QSslCertificatePrivate fails this test"); #endif QList<QSslCertificate> certList = @@ -838,7 +838,7 @@ void tst_QSslCertificate::nulInCN() void tst_QSslCertificate::nulInSan() { -#if QT_CONFIG(securetransport) || defined(Q_OS_WINRT) || QT_CONFIG(schannel) +#if QT_CONFIG(securetransport) || QT_CONFIG(schannel) QSKIP("Generic QSslCertificatePrivate fails this test"); #endif QList<QSslCertificate> certList = @@ -934,7 +934,7 @@ void tst_QSslCertificate::toText() QString txtcert = cert.toText(); #ifdef QT_NO_OPENSSL - QEXPECT_FAIL("", "QTBUG-40884: QSslCertificate::toText is not implemented on WinRT", Continue); + QEXPECT_FAIL("", "QSslCertificate::toText is not implemented on platforms which do not use openssl", Continue); #endif QVERIFY(QString::fromLatin1(txt098) == txtcert || QString::fromLatin1(txt100) == txtcert || @@ -990,7 +990,7 @@ void tst_QSslCertificate::verify() ) #ifdef QT_NO_OPENSSL - QEXPECT_FAIL("", "QTBUG-40884: WinRT API does not yet support verifying a chain", Abort); + QEXPECT_FAIL("", "Verifying a chain is not supported without openssl", Abort); // TODO? #endif // Empty chain is unspecified error errors = QSslCertificate::verify(toVerify); @@ -1323,7 +1323,7 @@ void tst_QSslCertificate::pkcs12() QList<QSslCertificate> caCerts; #ifdef QT_NO_OPENSSL - QEXPECT_FAIL("", "QTBUG-40884: WinRT API does not support pkcs12 imports", Abort); + QEXPECT_FAIL("", "pkcs12 imports are only supported when openssl is used", Abort); // TODO? #endif ok = QSslCertificate::importPkcs12(&f, &key, &cert, &caCerts); QVERIFY(ok); diff --git a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp index 1807315061..ce223a53ef 100644 --- a/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp +++ b/tests/auto/network/ssl/qsslkey/tst_qsslkey.cpp @@ -167,9 +167,9 @@ void tst_QSslKey::createPlainTestRows(bool pemOnly) foreach (KeyInfo keyInfo, keyInfoList) { if (pemOnly && keyInfo.format != QSsl::EncodingFormat::Pem) continue; -#if defined(Q_OS_WINRT) || QT_CONFIG(schannel) +#if QT_CONFIG(schannel) if (keyInfo.fileInfo.fileName().contains("RC2-64")) - continue; // WinRT/Schannel treats RC2 as 128 bit + continue; // Schannel treats RC2 as 128 bit #endif #if !defined(QT_NO_SSL) && defined(QT_NO_OPENSSL) // generic backend if (keyInfo.fileInfo.fileName().contains(QRegularExpression("-aes\\d\\d\\d-"))) @@ -702,11 +702,11 @@ void tst_QSslKey::encrypt() QFETCH(QByteArray, cipherText); QFETCH(QByteArray, iv); -#if defined(Q_OS_WINRT) || QT_CONFIG(schannel) - QEXPECT_FAIL("RC2-40-CBC, length 0", "WinRT/Schannel treats RC2 as 128-bit", Abort); - QEXPECT_FAIL("RC2-40-CBC, length 8", "WinRT/Schannel treats RC2 as 128-bit", Abort); - QEXPECT_FAIL("RC2-64-CBC, length 0", "WinRT/Schannel treats RC2 as 128-bit", Abort); - QEXPECT_FAIL("RC2-64-CBC, length 8", "WinRT/Schannel treats RC2 as 128-bit", Abort); +#if QT_CONFIG(schannel) + QEXPECT_FAIL("RC2-40-CBC, length 0", "Schannel treats RC2 as 128-bit", Abort); + QEXPECT_FAIL("RC2-40-CBC, length 8", "Schannel treats RC2 as 128-bit", Abort); + QEXPECT_FAIL("RC2-64-CBC, length 0", "Schannel treats RC2 as 128-bit", Abort); + QEXPECT_FAIL("RC2-64-CBC, length 8", "Schannel treats RC2 as 128-bit", Abort); #endif QByteArray encrypted = QSslKeyPrivate::encrypt(cipher, plainText, key, iv); QCOMPARE(encrypted, cipherText); diff --git a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp index 0ac87a9cb1..538864db6c 100644 --- a/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp +++ b/tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp @@ -1307,9 +1307,6 @@ protected slots: void tst_QSslSocket::protocolServerSide_data() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QTest::addColumn<QSsl::SslProtocol>("serverProtocol"); QTest::addColumn<QSsl::SslProtocol>("clientProtocol"); QTest::addColumn<bool>("works"); @@ -1413,9 +1410,6 @@ void tst_QSslSocket::protocolServerSide() void tst_QSslSocket::serverCipherPreferences() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) { qWarning("SSL not supported, skipping test"); return; @@ -1542,9 +1536,6 @@ void tst_QSslSocket::localCertificateChain() void tst_QSslSocket::setLocalCertificateChain() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) return; @@ -1587,9 +1578,6 @@ void tst_QSslSocket::setPrivateKey() void tst_QSslSocket::setSocketDescriptor() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) return; @@ -1995,9 +1983,6 @@ protected: void tst_QSslSocket::setEmptyKey() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) return; @@ -2019,9 +2004,6 @@ void tst_QSslSocket::setEmptyKey() void tst_QSslSocket::spontaneousWrite() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -2067,9 +2049,6 @@ void tst_QSslSocket::spontaneousWrite() void tst_QSslSocket::setReadBufferSize() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -2331,9 +2310,6 @@ void tst_QSslSocket::waitForMinusOne() #ifdef Q_OS_WIN QSKIP("QTBUG-24451 - indefinite wait may hang"); #endif -#ifdef Q_OS_WINRT // This can stay in case the one above goes away - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -2412,9 +2388,6 @@ protected: void tst_QSslSocket::verifyMode() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -2698,9 +2671,6 @@ void tst_QSslSocket::ignoreSslErrorsListWithSlot() void tst_QSslSocket::abortOnSslErrors() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -2800,9 +2770,6 @@ void tst_QSslSocket::writeBigChunk() void tst_QSslSocket::blacklistedCertificates() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -3064,9 +3031,6 @@ protected: void tst_QSslSocket::qtbug18498_peek() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -3140,9 +3104,6 @@ protected: void tst_QSslSocket::qtbug18498_peek2() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QFETCH_GLOBAL(bool, setProxy); if (setProxy) return; @@ -3246,9 +3207,6 @@ void tst_QSslSocket::qtbug18498_peek2() void tst_QSslSocket::dhServer() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) QSKIP("No SSL support"); @@ -3358,9 +3316,6 @@ void tst_QSslSocket::dhServerCustomParams() void tst_QSslSocket::ecdhServer() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) { qWarning("SSL not supported, skipping test"); return; @@ -3467,9 +3422,6 @@ void tst_QSslSocket::verifyClientCertificate() // success instead of failure etc.). QSKIP("This test can not work with Secure Transport"); #endif // QT_CONFIG(securetransport) -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif if (!QSslSocket::supportsSsl()) { qWarning("SSL not supported, skipping test"); return; @@ -4049,9 +4001,6 @@ void tst_QSslSocket::simplePskConnect() void tst_QSslSocket::ephemeralServerKey_data() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif QTest::addColumn<QString>("cipher"); QTest::addColumn<bool>("emptyKey"); @@ -4084,9 +4033,6 @@ void tst_QSslSocket::ephemeralServerKey() void tst_QSslSocket::pskServer() { -#ifdef Q_OS_WINRT - QSKIP("Server-side encryption is not implemented on WinRT."); -#endif #if QT_CONFIG(schannel) QSKIP("Schannel does not have PSK support implemented."); #endif diff --git a/tests/auto/network/ssl/ssl.pro b/tests/auto/network/ssl/ssl.pro index 169e9bce83..014ff34064 100644 --- a/tests/auto/network/ssl/ssl.pro +++ b/tests/auto/network/ssl/ssl.pro @@ -26,10 +26,6 @@ qtConfig(ssl) { } } -winrt: SUBDIRS -= \ - qsslsocket_onDemandCertificates_member \ - qsslsocket_onDemandCertificates_static \ - qtConfig(ssl) { qtConfig(private_tests) { SUBDIRS += qasn1element \ |