Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qtls_schannel.cpp File Reference

(adb18ad479d0fbdfed1399740d01314119ce9e36)

#include "qtlsbackend_schannel_p.h"
#include "qtlskey_schannel_p.h"
#include "qx509_schannel_p.h"
#include "qtls_schannel_p.h"
#include "../shared/qasn1element_p.h"
#include <QtNetwork/private/qsslcertificate_p.h>
#include <QtNetwork/private/qsslcipher_p.h>
#include <QtNetwork/private/qssl_p.h>
#include <QtNetwork/qsslcertificate.h>
#include <QtNetwork/qsslcertificateextension.h>
#include <QtNetwork/qsslsocket.h>
#include <QtCore/qscopeguard.h>
#include <QtCore/qoperatingsystemversion.h>
#include <QtCore/qregularexpression.h>
#include <QtCore/qdatastream.h>
#include <QtCore/qmutex.h>
#include <security.h>
#include <schnlsp.h>
Include dependency graph for qtls_schannel.cpp:

Go to the source code of this file.

Classes

struct  QTlsPrivate::SchannelCipherInfo

Namespaces

namespace  QTlsPrivate
 Namespace containing onternal types that TLS backends implement.

Macros

#define SECURITY_WIN32
#define SECBUFFER_ALERT   17
#define SECPKG_ATTR_APPLICATION_PROTOCOL   35
#define SEC_E_APPLICATION_PROTOCOL_MISMATCH   _HRESULT_TYPEDEF_(0x80090367L)
#define SP_PROT_TLS1_SERVER   0x00000040
#define SP_PROT_TLS1_CLIENT   0x00000080
#define SP_PROT_TLS1_0_SERVER   SP_PROT_TLS1_SERVER
#define SP_PROT_TLS1_0_CLIENT   SP_PROT_TLS1_CLIENT
#define SP_PROT_TLS1_0   (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_0_SERVER)
#define SP_PROT_TLS1_1_SERVER   0x00000100
#define SP_PROT_TLS1_1_CLIENT   0x00000200
#define SP_PROT_TLS1_1   (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_1_SERVER)
#define SP_PROT_TLS1_2_SERVER   0x00000400
#define SP_PROT_TLS1_2_CLIENT   0x00000800
#define SP_PROT_TLS1_2   (SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_2_SERVER)
#define SP_PROT_TLS1_3_SERVER   0x00001000
#define SP_PROT_TLS1_3_CLIENT   0x00002000
#define SP_PROT_TLS1_3   (SP_PROT_TLS1_3_CLIENT | SP_PROT_TLS1_3_SERVER)
#define BCRYPT_ECDH_ALGORITHM   L"ECDH"
#define BCRYPT_ECDSA_ALGORITHM   L"ECDSA"
#define MAP_PROTOCOL(sp_protocol, q_protocol)
#define DEBUG_WARN(message)
#define CHECK_ATTRIBUTE(attributeName)
#define CHECK_STATUS(status)

Functions

 Q_LOGGING_CATEGORY (lcTlsBackendSchannel, "qt.tlsbackend.schannel")
QByteArray _q_makePkcs12 (const QList< QSslCertificate > &certs, const QSslKey &key, const QString &passPhrase)
QAsn1Element _q_PKCS12_key (const QSslKey &key)
QList< QSslCipherQTlsPrivate::defaultCiphers ()
QT_WARNING_POP const SchannelCipherInfoQTlsPrivate::cipherInfoByOpenSslName (const QString &name)
QList< CRYPTO_SETTINGS > QTlsPrivate::cryptoSettingsForCiphers (const QList< QSslCipher > &ciphers)
QList< QSslCipherQTlsPrivate::ciphersByName (QStringView schannelSuiteName)
bool QTlsPrivate::containsTls13Cipher (const QList< QSslCipher > &ciphers)
static void QTlsPrivate::attachPrivateKeyToCertificate (const QSslCertificate &certificate, const QSslKey &privateKey)

Variables

QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED std::array< SchannelCipherInfo, 44 > QTlsPrivate::schannelCipherInfo
UNICODE_STRING QTlsPrivate::cbcChainingMode
UNICODE_STRING QTlsPrivate::gcmChainingMode

Macro Definition Documentation

◆ BCRYPT_ECDH_ALGORITHM

#define BCRYPT_ECDH_ALGORITHM   L"ECDH"

Definition at line 93 of file qtls_schannel.cpp.

◆ BCRYPT_ECDSA_ALGORITHM

#define BCRYPT_ECDSA_ALGORITHM   L"ECDSA"

Definition at line 96 of file qtls_schannel.cpp.

◆ CHECK_ATTRIBUTE

#define CHECK_ATTRIBUTE ( attributeName)
Value:
do { \
const DWORD req##attributeName = isClient ? ISC_REQ_##attributeName : ASC_REQ_##attributeName; \
const DWORD ret##attributeName = isClient ? ISC_RET_##attributeName : ASC_RET_##attributeName; \
if (!(requirements & req##attributeName) != !(attributes & ret##attributeName)) { \
DEBUG_WARN("Missing attribute \"" #attributeName "\""); \
return false; \
} \
} while (false)
return ret

◆ CHECK_STATUS

#define CHECK_STATUS ( status)
Value:
if (status != SEC_E_OK) { \
setErrorAndEmit(d, QAbstractSocket::SslInternalError, \
QSslSocket::tr("Failed to query the TLS context: %1") \
.arg(schannelErrorToString(status))); \
return false; \
}
SSL_CTX int void * arg

◆ DEBUG_WARN

#define DEBUG_WARN ( message)

◆ MAP_PROTOCOL

#define MAP_PROTOCOL ( sp_protocol,
q_protocol )
Value:
if (protocol & sp_protocol) { \
Q_ASSERT(!(protocol & ~sp_protocol)); \
return q_protocol; \
}

◆ SEC_E_APPLICATION_PROTOCOL_MISMATCH

#define SEC_E_APPLICATION_PROTOCOL_MISMATCH   _HRESULT_TYPEDEF_(0x80090367L)

Definition at line 46 of file qtls_schannel.cpp.

◆ SECBUFFER_ALERT

#define SECBUFFER_ALERT   17

Definition at line 38 of file qtls_schannel.cpp.

◆ SECPKG_ATTR_APPLICATION_PROTOCOL

#define SECPKG_ATTR_APPLICATION_PROTOCOL   35

Definition at line 41 of file qtls_schannel.cpp.

◆ SECURITY_WIN32

#define SECURITY_WIN32

Definition at line 27 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_0

#define SP_PROT_TLS1_0   (SP_PROT_TLS1_0_CLIENT | SP_PROT_TLS1_0_SERVER)

Definition at line 63 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_0_CLIENT

#define SP_PROT_TLS1_0_CLIENT   SP_PROT_TLS1_CLIENT

Definition at line 60 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_0_SERVER

#define SP_PROT_TLS1_0_SERVER   SP_PROT_TLS1_SERVER

Definition at line 57 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_1

#define SP_PROT_TLS1_1   (SP_PROT_TLS1_1_CLIENT | SP_PROT_TLS1_1_SERVER)

Definition at line 72 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_1_CLIENT

#define SP_PROT_TLS1_1_CLIENT   0x00000200

Definition at line 69 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_1_SERVER

#define SP_PROT_TLS1_1_SERVER   0x00000100

Definition at line 66 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_2

#define SP_PROT_TLS1_2   (SP_PROT_TLS1_2_CLIENT | SP_PROT_TLS1_2_SERVER)

Definition at line 81 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_2_CLIENT

#define SP_PROT_TLS1_2_CLIENT   0x00000800

Definition at line 78 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_2_SERVER

#define SP_PROT_TLS1_2_SERVER   0x00000400

Definition at line 75 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_3

#define SP_PROT_TLS1_3   (SP_PROT_TLS1_3_CLIENT | SP_PROT_TLS1_3_SERVER)

Definition at line 90 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_3_CLIENT

#define SP_PROT_TLS1_3_CLIENT   0x00002000

Definition at line 87 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_3_SERVER

#define SP_PROT_TLS1_3_SERVER   0x00001000

Definition at line 84 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_CLIENT

#define SP_PROT_TLS1_CLIENT   0x00000080

Definition at line 54 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_SERVER

#define SP_PROT_TLS1_SERVER   0x00000040

Definition at line 51 of file qtls_schannel.cpp.

Function Documentation

◆ _q_makePkcs12()

QByteArray _q_makePkcs12 ( const QList< QSslCertificate > & certs,
const QSslKey & key,
const QString & passPhrase )
extern

Definition at line 250 of file qsslsocket_qt.cpp.

References QAsn1Element::fromInteger().

Here is the call graph for this function:

◆ _q_PKCS12_key()

QAsn1Element _q_PKCS12_key ( const QSslKey & key)
extern

Definition at line 138 of file qsslsocket_qt.cpp.

References QAsn1Element::fromInteger(), QAsn1Element::NullType, and QAsn1Element::OctetStringType.

Here is the call graph for this function:

◆ Q_LOGGING_CATEGORY()

Q_LOGGING_CATEGORY ( lcTlsBackendSchannel ,
"qt.tlsbackend.schannel"  )