40 #ifndef QTLSBACKEND_P_H
41 #define QTLSBACKEND_P_H
54 #include <QtNetwork/private/qtnetworkglobal_p.h>
64 #include <QtNetwork/qsslcertificate.h>
65 #include <QtNetwork/qsslcipher.h>
66 #include <QtNetwork/qsslkey.h>
67 #include <QtNetwork/qssl.h>
69 #include <QtCore/qloggingcategory.h>
70 #include <QtCore/qsharedpointer.h>
71 #include <QtCore/qnamespace.h>
72 #include <QtCore/qobject.h>
73 #include <QtCore/qglobal.h>
74 #include <QtCore/qstring.h>
75 #include <QtCore/qlist.h>
76 #include <QtCore/qmap.h>
97 class Q_NETWORK_PRIVATE_EXPORT
TlsKey {
105 const QByteArray &passPhrase,
bool deepClear) = 0;
107 const QByteArray &passPhrase,
bool deepClear) = 0;
121 virtual void clear(
bool deepClear) = 0;
155 virtual TlsKey *publicKey()
const;
173 virtual size_t hash(
size_t seed)
const noexcept = 0;
191 class Q_NETWORK_PRIVATE_EXPORT TlsCryptograph :
public QObject
194 virtual ~TlsCryptograph();
197 virtual void checkSettingSslContext(std::shared_ptr<QSslContext> tlsContext);
198 virtual std::shared_ptr<QSslContext> sslContext()
const;
202 virtual void startClientEncryption() = 0;
203 virtual void startServerEncryption() = 0;
204 virtual void continueHandshake() = 0;
205 virtual void enableHandshakeContinuation();
207 virtual void disconnected() = 0;
208 virtual void cancelCAFetch();
212 virtual void transmit() = 0;
213 virtual bool hasUndecryptedData()
const;
219 const QString &errorDescription)
const;
222 class TlsCryptograph;
227 class Q_NETWORK_PRIVATE_EXPORT DtlsBase
235 virtual QString errorString()
const = 0;
237 virtual void clearDtlsError() = 0;
243 virtual bool setCookieGeneratorParameters(
const GenParams &
params) = 0;
244 virtual GenParams cookieGeneratorParameters()
const = 0;
248 class Q_NETWORK_EXPORT DtlsCookieVerifier :
virtual public DtlsBase
257 class Q_NETWORK_PRIVATE_EXPORT DtlsCryptograph :
virtual public DtlsBase
264 virtual quint16 peerPort()
const = 0;
265 virtual void setPeerVerificationName(
const QString &
name) = 0;
266 virtual QString peerVerificationName()
const = 0;
268 virtual void setDtlsMtuHint(
quint16 mtu) = 0;
269 virtual quint16 dtlsMtuHint()
const = 0;
272 virtual bool isConnectionEncrypted()
const = 0;
284 virtual QSslCipher dtlsSessionCipher()
const = 0;
293 class DtlsCookieVerifier;
294 class DtlsCryptograph;
309 virtual bool isValid()
const;
310 virtual long tlsLibraryVersionNumber()
const;
311 virtual QString tlsLibraryVersionString()
const;
312 virtual long tlsLibraryBuildVersionNumber()
const;
313 virtual QString tlsLibraryBuildVersionString()
const;
314 virtual void ensureInitialized()
const;
328 virtual QTlsPrivate::TlsCryptograph *createTlsCryptograph()
const;
329 virtual QTlsPrivate::DtlsCryptograph *createDtlsCryptograph(
class QDtls *qObject,
int mode)
const;
330 virtual QTlsPrivate::DtlsCookieVerifier *createDtlsCookieVerifier()
const;
341 virtual int curveIdFromShortName(
const QString &
name)
const;
342 virtual int curveIdFromLongName(
const QString &
name)
const;
343 virtual QString shortNameForId(
int cid)
const;
344 virtual QString longNameForId(
int cid)
const;
345 virtual bool isTlsNamedCurve(
int cid)
const;
354 static QString defaultBackendName();
363 static constexpr
const int nameIndexSchannel = 0;
364 static constexpr
const int nameIndexSecureTransport = 1;
365 static constexpr
const int nameIndexOpenSSL = 2;
366 static constexpr
const int nameIndexCertOnly = 3;
370 template<
class DynamicType,
class TLSObject>
373 return static_cast<DynamicType *
>(
o.d->backend.get());
379 int hintLength,
unsigned maxIdentityLen,
unsigned maxPskLen);
381 const QByteArray &identityHint,
unsigned maxPskLen);
385 const QString &protocolString);
387 const QString &protocolString);
398 static void resetDefaultEllipticCurves();
425 virtual void forceAutotestSecurityLevel();
431 #define QTlsBackend_iid "org.qt-project.Qt.QTlsBackend"
small capitals from c petite p scientific i
[1]
The QByteArray class provides an array of bytes.
The QDateTime class provides date and time functions.
This class provides encryption for UDP sockets.
HandshakeState
Describes the current state of DTLS handshake.
The QHostAddress class provides an IP address.\inmodule QtNetwork.
The QIODevice class is the base interface class of all I/O devices in Qt.
The QObject class is the base class of all Qt objects.
The QSslCertificate class provides a convenient API for an X509 certificate.
The QSslCipher class represents an SSL cryptographic cipher.
The QSslConfiguration class holds the configuration and state of an SSL connection.
NextProtocolNegotiationStatus
The QSslError class provides an SSL error.
The QSslKey class provides an interface for private and public keys.
The QSslPreSharedKeyAuthenticator class provides authentication data for pre shared keys (PSK) cipher...
The QSslSocket class provides an SSL encrypted socket for both clients and servers.
The QString class provides a Unicode character string.
The QStringList class provides a list of strings.
virtual QString backendName() const =0
static DynamicType * backend(const TLSObject &o)
virtual QList< QSsl::SupportedFeature > supportedFeatures() const =0
virtual QList< QSsl::ImplementedClass > implementedClasses() const =0
virtual QList< QSsl::SslProtocol > supportedProtocols() const =0
virtual void clear(bool deepClear)=0
virtual QByteArray derFromPem(const QByteArray &pem, QMap< QByteArray, QByteArray > *headers) const =0
virtual void fromHandle(Qt::HANDLE handle, KeyType type)=0
virtual void decodeDer(KeyType type, KeyAlgorithm algorithm, const QByteArray &der, const QByteArray &passPhrase, bool deepClear)=0
virtual QByteArray encrypt(Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv) const =0
virtual Qt::HANDLE handle() const =0
virtual bool isNull() const =0
virtual KeyType type() const =0
virtual QByteArray pemFromDer(const QByteArray &der, const QMap< QByteArray, QByteArray > &headers) const =0
virtual KeyAlgorithm algorithm() const =0
virtual int length() const =0
virtual bool isPkcs8() const =0
virtual QByteArray decrypt(Cipher cipher, const QByteArray &data, const QByteArray &passPhrase, const QByteArray &iv) const =0
virtual void decodePem(KeyType type, KeyAlgorithm algorithm, const QByteArray &pem, const QByteArray &passPhrase, bool deepClear)=0
virtual QByteArray toPem(const QByteArray &passPhrase) const =0
virtual QMultiMap< QSsl::AlternativeNameEntryType, QString > subjectAlternativeNames() const =0
virtual QDateTime expiryDate() const =0
virtual QList< QByteArray > issuerInfoAttributes() const =0
virtual ~X509Certificate()
virtual QStringList subjectInfo(const QByteArray &attribute) const =0
virtual bool isExtensionSupported(qsizetype i) const =0
virtual QStringList issuerInfo(const QByteArray &attribute) const =0
virtual size_t hash(size_t seed) const noexcept=0
virtual bool isNull() const =0
virtual QByteArray version() const =0
virtual QString oidForExtension(qsizetype i) const =0
virtual Qt::HANDLE handle() const =0
virtual QList< QByteArray > subjectInfoAttributes() const =0
virtual bool isEqual(const X509Certificate &other) const =0
virtual QByteArray toPem() const =0
virtual QString toText() const =0
virtual QVariant valueForExtension(qsizetype i) const =0
virtual QString nameForExtension(qsizetype i) const =0
virtual QStringList issuerInfo(QSslCertificate::SubjectInfo subject) const =0
virtual bool isSelfSigned() const =0
virtual QStringList subjectInfo(QSslCertificate::SubjectInfo subject) const =0
virtual QDateTime effectiveDate() const =0
virtual qsizetype numberOfExtensions() const =0
virtual QByteArray serialNumber() const =0
virtual QByteArray toDer() const =0
virtual bool isExtensionCritical(qsizetype i) const =0
The QUdpSocket class provides a UDP socket.
The QVariant class acts like a union for the most common Qt data types.
QList< QSslCipher > defaultCiphers()
QList< QSslCertificate > systemCaCertificates()
bool(*)(QIODevice *device, QSslKey *key, QSslCertificate *cert, QList< QSslCertificate > *caCertificates, const QByteArray &passPhrase) X509Pkcs12ReaderPtr
QList< QSslCertificate >(*)(const QByteArray &pem, int count) X509PemReaderPtr
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld init[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
EGLOutputLayerEXT EGLint attribute
#define Q_DISABLE_COPY_MOVE(Class)
GLuint64 GLenum void * handle
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const void * bits
GLuint GLuint64EXT address
GLdouble GLdouble GLdouble GLdouble q
Q_DECLARE_INTERFACE(QTlsBackend, QTlsBackend_iid)
QList< QSslCertificate > cert
[0]
socket disconnectFromHost()
[0]
clientDtls setPeer(address, port, peerName)
dtls ignoreVerificationErrors(expectedSslErrors)
This class defines parameters for DTLS cookie generator.