summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qocsp/tst_qocsp.cpp
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2021-03-25 12:41:08 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2021-04-22 22:51:54 +0200
commitd385158d5213ef568b7629e2aa4a818016bbffac (patch)
tree2c111b462fe39dffacb3c7f5cdd8db269f87ed6c /tests/auto/network/ssl/qocsp/tst_qocsp.cpp
parent6b1a7341fed4b9456ea6bfa2de7412d45ef56c65 (diff)
Move plugin code from QtNetwork to qtbase/plugins
All TLS (and non-TLS) backends that QSsl classes rely on are now in plugins/tls (as openssl, securetransport, schannel and certonly plugins). For now, I have to disable some tests that were using OpenSSL calls - this to be refactored/re-thought. These include: qsslsocket auto-test (test-case where we work with private keys), qsslkey auto-test (similar to qsslsocket - test-case working with keys using OpenSSL calls). qasn1element moved to plugins too, so its auto-test have to be re-thought. Since now we can have more than one working TLS-backend on a given platform, the presence of OpenSSL also means I force this backend as active before running tests, to make sure features implemented only in OpenSSL-backend are tested. OCSP auto test is disabled for now, since it heavily relies on OpenSSL symbols (to be refactored). [ChangeLog][QtNetwork][QSslSocket] QSslSocket by default prefers 'openssl' backend if it is available. [ChangeLog][QtNetwork][QSslSocket] TLS-backends are not mutually exclusive anymore, depending on a platform, more than one TLS backend can be built. E.g., configuring Qt with -openssl does not prevent SecureTransport or Schannel plugin from being built. Fixes: QTBUG-91928 Change-Id: I4c05e32f10179066bee3a518bdfdd6c4b15320c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'tests/auto/network/ssl/qocsp/tst_qocsp.cpp')
-rw-r--r--tests/auto/network/ssl/qocsp/tst_qocsp.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp
index 37ce9a4f6d..5c28f5a8ec 100644
--- a/tests/auto/network/ssl/qocsp/tst_qocsp.cpp
+++ b/tests/auto/network/ssl/qocsp/tst_qocsp.cpp
@@ -31,8 +31,6 @@
#include <QtNetwork/private/qtnetworkglobal_p.h>
-#include <QtNetwork/private/qsslsocket_openssl_symbols_p.h>
-
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qtcpserver.h>
#include <QtNetwork/qsslerror.h>
@@ -66,6 +64,9 @@ QT_BEGIN_NAMESPACE
namespace {
+// TLSTODO: the test is temporarily disabled due to openssl code
+// moved into plugin and not in QtNetwork anymore.
+#if 0
using OcspResponse = QSharedPointer<OCSP_RESPONSE>;
using BasicResponse = QSharedPointer<OCSP_BASICRESP>;
using SingleResponse = QSharedPointer<OCSP_SINGLERESP>;
@@ -74,6 +75,9 @@ using EvpKey = QSharedPointer<EVP_PKEY>;
using Asn1Time = QSharedPointer<ASN1_TIME>;
using CertificateChain = QList<QSslCertificate>;
+// TLSTODO: test temporarily disabled due to openssl code moved
+// into plugin and not in QtNetwork anymore.
+
using NativeX509Ptr = X509 *;
class X509Stack {
@@ -372,12 +376,16 @@ void OcspServer::incomingConnection(qintptr socketDescriptor)
serverSocket.startServerEncryption();
}
+#endif // if 0
+
} // unnamed namespace
class tst_QOcsp : public QObject
{
Q_OBJECT
-
+// TLSTODO: test temporarily disabled due to openssl code moved
+// into plugin and not in QtNetwork anymore.
+#if 0
public slots:
void initTestCase();
@@ -426,6 +434,7 @@ private:
QSslError::OcspResponseCertIdUnknown,
QSslError::OcspResponseExpired,
QSslError::OcspStatusUnknown};
+#endif // if 0
};
#define QCOMPARE_SINGLE_ERROR(sslSocket, expectedError) \
@@ -446,6 +455,9 @@ private:
QSslKey key; \
QVERIFY(loadPrivateKey(QLatin1String(keyFileName), key))
+// TLSTODO: test temporarily disabled due to openssl code moved
+// into plugin and not in QtNetwork anymore.
+#if 0
QString tst_QOcsp::certDirPath;
void tst_QOcsp::initTestCase()
@@ -827,6 +839,8 @@ CertificateChain tst_QOcsp::subjectToChain(const CertificateChain &chain)
return CertificateChain() << chain[0];
}
+#endif // if 0
+
QT_END_NAMESPACE
QTEST_MAIN(tst_QOcsp)