summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qtlsbackend_p.h
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2021-01-25 11:28:48 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2021-01-28 16:21:07 +0100
commit1a2dd9276759742a7eda704341ee618d296ad8bf (patch)
treed6d0b7f8cf473c2d682aeae12bc2bad0680ace0b /src/network/ssl/qtlsbackend_p.h
parent795ea19ca0a7e484793655b35f19de8dbc88e987 (diff)
TLS backend: merge with its factory
QTlsBackend is a factory itself - it creates TLS/X509 objects. Having an intermediary between Factory->Backend->TLS primitive does not look very natural thus let's squash the first two parts. Backend is a factory creating TLS primitives, but its static functions also provide information about backends availablei and give access to those backends. Fixes: QTBUG-90606 Task-number: QTBUG-65922 Change-Id: I8409d81fd11fb46e6ab4465b4937a7680a8c2447 Reviewed-by: Alex Blasche <alexander.blasche@qt.io> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/network/ssl/qtlsbackend_p.h')
-rw-r--r--src/network/ssl/qtlsbackend_p.h32
1 files changed, 8 insertions, 24 deletions
diff --git a/src/network/ssl/qtlsbackend_p.h b/src/network/ssl/qtlsbackend_p.h
index 9c4f2d3eb8..4650848a53 100644
--- a/src/network/ssl/qtlsbackend_p.h
+++ b/src/network/ssl/qtlsbackend_p.h
@@ -107,8 +107,6 @@ class DtlsCookieVerifier;
// Factory, creating back-end specific implementations of
// different entities QSslSocket is using.
-// TLSTODO: consider merging with ... it's own factory
-// below, no real benefit in having this split.
class Q_NETWORK_EXPORT QTlsBackend : public QObject
{
Q_OBJECT
@@ -116,7 +114,10 @@ public:
QTlsBackend();
~QTlsBackend() override;
- virtual QString backendName() const;
+ virtual QString backendName() const = 0;
+ virtual QList<QSsl::SslProtocol> supportedProtocols() const = 0;
+ virtual QList<QSsl::SupportedFeature> supportedFeatures() const = 0;
+ virtual QList<QSsl::ImplementedClass> implementedClasses() const = 0;
// X509 and keys:
virtual QSsl::TlsKey *createKey() const;
@@ -133,26 +134,9 @@ public:
virtual QSsl::X509DerReaderPtr X509DerReader() const;
virtual QSsl::X509Pkcs12ReaderPtr X509Pkcs12Reader() const;
- Q_DISABLE_COPY_MOVE(QTlsBackend)
-};
-
-// Factory for a backend.
-class Q_NETWORK_EXPORT QTlsBackendFactory : public QObject
-{
- Q_OBJECT
-public:
- QTlsBackendFactory();
- ~QTlsBackendFactory() override;
-
- virtual QString backendName() const = 0;
- virtual QTlsBackend *create() const = 0;
- virtual QList<QSsl::SslProtocol> supportedProtocols() const = 0;
- virtual QList<QSsl::SupportedFeature> supportedFeatures() const = 0;
- virtual QList<QSsl::ImplementedClass> implementedClasses() const = 0;
-
static QList<QString> availableBackendNames();
static QString defaultBackendName();
- static QTlsBackend *create(const QString &backendName);
+ static QTlsBackend *findBackend(const QString &backendName);
static QList<QSsl::SslProtocol> supportedProtocols(const QString &backendName);
static QList<QSsl::SupportedFeature> supportedFeatures(const QString &backendName);
@@ -165,11 +149,11 @@ public:
static const QString builtinBackendNames[];
- Q_DISABLE_COPY_MOVE(QTlsBackendFactory)
+ Q_DISABLE_COPY_MOVE(QTlsBackend)
};
-#define QTlsBackendFactory_iid "org.qt-project.Qt.QTlsBackendFactory"
-Q_DECLARE_INTERFACE(QTlsBackendFactory, QTlsBackendFactory_iid);
+#define QTlsBackend_iid "org.qt-project.Qt.QTlsBackend"
+Q_DECLARE_INTERFACE(QTlsBackend, QTlsBackend_iid);
QT_END_NAMESPACE