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
qtls_schannel.cpp File Reference

(2d521002ca024b71525036a0a6f5d02bb09b3ed7)

#include "qtlsbackend_schannel_p.h"
#include "qtlskey_schannel_p.h"
#include "qx509_schannel_p.h"
#include "qtls_schannel_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)
 
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)
 

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 91 of file qtls_schannel.cpp.

Referenced by QTlsPrivate::cryptoSettingsForCiphers().

◆ BCRYPT_ECDSA_ALGORITHM

#define BCRYPT_ECDSA_ALGORITHM   L"ECDSA"

Definition at line 94 of file qtls_schannel.cpp.

Referenced by QTlsPrivate::cryptoSettingsForCiphers().

◆ 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) { \
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 44 of file qtls_schannel.cpp.

◆ SECBUFFER_ALERT

#define SECBUFFER_ALERT   17

Definition at line 36 of file qtls_schannel.cpp.

◆ SECPKG_ATTR_APPLICATION_PROTOCOL

#define SECPKG_ATTR_APPLICATION_PROTOCOL   35

Definition at line 39 of file qtls_schannel.cpp.

◆ SECURITY_WIN32

#define SECURITY_WIN32

Definition at line 25 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 61 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_0_CLIENT

#define SP_PROT_TLS1_0_CLIENT   SP_PROT_TLS1_CLIENT

Definition at line 58 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_0_SERVER

#define SP_PROT_TLS1_0_SERVER   SP_PROT_TLS1_SERVER

Definition at line 55 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 70 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_1_CLIENT

#define SP_PROT_TLS1_1_CLIENT   0x00000200

Definition at line 67 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_1_SERVER

#define SP_PROT_TLS1_1_SERVER   0x00000100

Definition at line 64 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 79 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_2_CLIENT

#define SP_PROT_TLS1_2_CLIENT   0x00000800

Definition at line 76 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_2_SERVER

#define SP_PROT_TLS1_2_SERVER   0x00000400

Definition at line 73 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 88 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_3_CLIENT

#define SP_PROT_TLS1_3_CLIENT   0x00002000

Definition at line 85 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_3_SERVER

#define SP_PROT_TLS1_3_SERVER   0x00001000

Definition at line 82 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_CLIENT

#define SP_PROT_TLS1_CLIENT   0x00000080

Definition at line 52 of file qtls_schannel.cpp.

◆ SP_PROT_TLS1_SERVER

#define SP_PROT_TLS1_SERVER   0x00000040

Definition at line 49 of file qtls_schannel.cpp.

Function Documentation

◆ _q_makePkcs12()

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

Definition at line 249 of file qsslsocket_qt.cpp.

References _q_PKCS12_bag(), _q_PKCS12_mac(), _q_PKCS7_data(), ba, certs, QAsn1Element::fromInteger(), QAsn1Element::fromVector(), items, QAsn1Element::write(), and QIODeviceBase::WriteOnly.

+ Here is the call graph for this function:

◆ Q_LOGGING_CATEGORY()

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