Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qtlsbackend_openssl_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QTLSBACKEND_OPENSSL_P_H
5#define QTLSBACKEND_OPENSSL_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtNetwork/private/qtnetworkglobal_p.h>
19
20#include <QtNetwork/qssldiffiehellmanparameters.h>
21#include <QtNetwork/qsslcertificate.h>
22
23#include <QtNetwork/private/qtlsbackend_p.h>
24
25#include <QtCore/qglobal.h>
26#include <QtCore/qlist.h>
27
28#include <openssl/ssl.h>
29
31
32class QTlsBackendOpenSSL final : public QTlsBackend
33{
37
38public:
39
41 static void logAndClearErrorQueue();
42 static void clearErrorQueue();
43
44 // Index used in SSL_get_ex_data to get the matching TlsCryptographerOpenSSL:
46
48 static QSslCipher qt_OpenSSL_cipher_to_QSslCipher(const SSL_CIPHER *cipher);
49private:
50 static bool ensureLibraryLoaded();
51 QString backendName() const override;
52 bool isValid() const override;
53 long tlsLibraryVersionNumber() const override;
54 QString tlsLibraryVersionString() const override;
55 long tlsLibraryBuildVersionNumber() const override;
57
58 void ensureInitialized() const override;
59 void ensureCiphersAndCertsLoaded() const;
60 static void resetDefaultCiphers();
61
62 QList<QSsl::SslProtocol> supportedProtocols() const override;
63 QList<QSsl::SupportedFeature> supportedFeatures() const override;
64 QList<QSsl::ImplementedClass> implementedClasses() const override;
65
66 // QSslKey:
67 QTlsPrivate::TlsKey *createKey() const override;
68
69 // QSslCertificate:
71 QList<QSslCertificate> systemCaCertificates() const override;
72
73 QTlsPrivate::TlsCryptograph *createTlsCryptograph() const override;
74 QTlsPrivate::DtlsCookieVerifier *createDtlsCookieVerifier() const override;
75 QTlsPrivate::DtlsCryptograph *createDtlsCryptograph(QDtls *q, int mode) const override;
76
81
82 // Elliptic curves:
83 QList<int> ellipticCurvesIds() const override;
84 int curveIdFromShortName(const QString &name) const override;
85 int curveIdFromLongName(const QString &name) const override;
86 QString shortNameForId(int cid) const override;
87 QString longNameForId(int cid) const override;
88 bool isTlsNamedCurve(int cid) const override;
89
90 // DH parameters:
92 int dhParametersFromDer(const QByteArray &derData, QByteArray *data) const override;
93 int dhParametersFromPem(const QByteArray &pemData, QByteArray *data) const override;
94
95 void forceAutotestSecurityLevel() override;
96};
97
99
101
102#endif // QTLSBACKEND_OPENSSL_P_H
103
104
\inmodule QtCore
Definition qbytearray.h:57
This class provides encryption for UDP sockets.
Definition qdtls.h:83
The QSslCipher class represents an SSL cryptographic cipher.
Definition qsslcipher.h:22
The QSslDiffieHellmanParameters class provides an interface for Diffie-Hellman parameters for servers...
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
QTlsPrivate::X509DerReaderPtr X509DerReader() const override
static QSslCipher qt_OpenSSL_cipher_to_QSslCipher(const SSL_CIPHER *cipher)
QString tlsLibraryBuildVersionString() const override
QList< QSsl::SslProtocol > supportedProtocols() const override
QTlsPrivate::X509ChainVerifyPtr X509Verifier() const override
bool isTlsNamedCurve(int cid) const override
long tlsLibraryVersionNumber() const override
long tlsLibraryBuildVersionNumber() const override
QTlsPrivate::DtlsCryptograph * createDtlsCryptograph(QDtls *q, int mode) const override
static void logAndClearErrorQueue()
int curveIdFromShortName(const QString &name) const override
QTlsPrivate::X509PemReaderPtr X509PemReader() const override
int dhParametersFromDer(const QByteArray &derData, QByteArray *data) const override
int curveIdFromLongName(const QString &name) const override
bool isValid() const override
QList< int > ellipticCurvesIds() const override
QString shortNameForId(int cid) const override
QTlsPrivate::X509Certificate * createCertificate() const override
void forceAutotestSecurityLevel() override
QTlsPrivate::X509Pkcs12ReaderPtr X509Pkcs12Reader() const override
QString longNameForId(int cid) const override
static QString msgErrorsDuringHandshake()
QList< QSslCertificate > systemCaCertificates() const override
QList< QSsl::SupportedFeature > supportedFeatures() const override
int dhParametersFromPem(const QByteArray &pemData, QByteArray *data) const override
QList< QSsl::ImplementedClass > implementedClasses() const override
QTlsPrivate::DtlsCookieVerifier * createDtlsCookieVerifier() const override
void ensureInitialized() const override
QTlsPrivate::TlsKey * createKey() const override
QTlsPrivate::TlsCryptograph * createTlsCryptograph() const override
QString backendName() const override
QString tlsLibraryVersionString() const override
static QString getErrorsFromOpenSsl()
QTlsBackend is a factory class, providing implementations for the QSsl classes.
TlsKey is an abstract class, that allows a TLS plugin to provide an underlying implementation for the...
X509Certificate is an abstract class that allows a TLS backend to provide an implementation of the QS...
Combined button and popup list for selecting options.
QList< QSslCertificate >(*)(const QByteArray &pem, int count) X509PemReaderPtr
bool(*)(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList< QSslCertificate > *caCertificates, const QByteArray &passPhrase) X509Pkcs12ReaderPtr
QList< QSslError >(*)(const QList< QSslCertificate > &chain, const QString &hostName) X509ChainVerifyPtr
X509PemReaderPtr X509DerReaderPtr
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLenum mode
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLuint name
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
#define QTlsBackend_iid
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)
#define Q_INTERFACES(x)