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
QTlsPrivate Namespace Reference

Namespace containing onternal types that TLS backends implement. More...

Classes

class  QSecureTransportContext
 
struct  SchannelCipherInfo
 
class  TlsCryptographOpenSSL
 
class  TlsCryptographSchannel
 
class  TlsCryptographSecureTransport
 
class  TlsKey
 TlsKey is an abstract class, that allows a TLS plugin to provide an underlying implementation for the class QSslKey. More...
 
class  TlsKeyBase
 
class  TlsKeyGeneric
 
class  TlsKeyOpenSSL
 
class  TlsKeySchannel
 
class  TlsKeySecureTransport
 
class  X509Certificate
 X509Certificate is an abstract class that allows a TLS backend to provide an implementation of the QSslCertificate class. More...
 
class  X509CertificateBase
 
class  X509CertificateGeneric
 
class  X509CertificateOpenSSL
 
class  X509CertificateSchannel
 
class  X509CertificateSecureTransport
 

Typedefs

using X509ChainVerifyPtr
 
using X509PemReaderPtr = QList<QSslCertificate> (*)(const QByteArray &pem, int count)
 
using X509DerReaderPtr = X509PemReaderPtr
 
using X509Pkcs12ReaderPtr
 

Enumerations

enum class  Cipher {
  DesCbc , DesEde3Cbc , Rc2Cbc , Aes128Cbc ,
  Aes192Cbc , Aes256Cbc
}
 

Functions

int q_X509Callback (int ok, X509_STORE_CTX *ctx)
 
int q_X509CallbackDirect (int ok, X509_STORE_CTX *ctx)
 
QList< QByteArrayfetchSslCertificateData ()
 
static unsigned q_ssl_psk_client_callback (SSL *ssl, const char *hint, char *identity, unsigned max_identity_len, unsigned char *psk, unsigned max_psk_len)
 
static unsigned int q_ssl_psk_server_callback (SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len)
 
void qt_AlertInfoCallback (const SSL *connection, int from, int value)
 
QList< QSslCertificatesystemCaCertificates ()
 
QByteArray doCrypt (QSslKeyPrivate::Cipher cipher, const QByteArray &data, const QByteArray &key, const QByteArray &iv, bool enc)
 
int qt_X509Callback (int ok, X509_STORE_CTX *ctx)
 
QList< QSslCipherdefaultCiphers ()
 
QT_WARNING_POP const SchannelCipherInfocipherInfoByOpenSslName (const QString &name)
 
QList< CRYPTO_SETTINGS > cryptoSettingsForCiphers (const QList< QSslCipher > &ciphers)
 
QList< QSslCipherciphersByName (QStringView schannelSuiteName)
 
bool containsTls13Cipher (const QList< QSslCipher > &ciphers)
 
QSslCipher QSslCipher_from_SSLCipherSuite (SSLCipherSuite cipher)
 
SSLContextRef qt_createSecureTransportContext (QSslSocket::SslMode mode)
 
 Q_GLOBAL_STATIC_WITH_ARGS (OidLengthMap, oidLengthMap,(createOidMap())) namespace
 

Variables

QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED std::array< SchannelCipherInfo, 44 > schannelCipherInfo
 
UNICODE_STRING cbcChainingMode
 
UNICODE_STRING gcmChainingMode
 
static const uint8_t dhparam []
 

Detailed Description

Namespace containing onternal types that TLS backends implement.

(Network-private)

This namespace is private to Qt and the backends that implement its TLS support.

Typedef Documentation

◆ X509ChainVerifyPtr

Initial value:
QList<QSslError> (*)(const QList<QSslCertificate> &chain,
const QString &hostName)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129

Definition at line 144 of file qtlsbackend_p.h.

◆ X509DerReaderPtr

◆ X509PemReaderPtr

Definition at line 146 of file qtlsbackend_p.h.

◆ X509Pkcs12ReaderPtr

Initial value:
QList<QSslCertificate> *caCertificates,
const QByteArray &passPhrase)
IOBluetoothDevice * device
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore \reentrant
Definition qiodevice.h:34
The QSslCertificate class provides a convenient API for an X509 certificate.
The QSslKey class provides an interface for private and public keys.
Definition qsslkey.h:23
GLuint64 key
QList< QSslCertificate > cert
[0]

Definition at line 148 of file qtlsbackend_p.h.

Enumeration Type Documentation

◆ Cipher

enum class QTlsPrivate::Cipher
strong
Enumerator
DesCbc 
DesEde3Cbc 
Rc2Cbc 
Aes128Cbc 
Aes192Cbc 
Aes256Cbc 

Definition at line 29 of file qssl_p.h.

Function Documentation

◆ cipherInfoByOpenSslName()

QT_WARNING_POP const SchannelCipherInfo * QTlsPrivate::cipherInfoByOpenSslName ( const QString & name)

Definition at line 207 of file qtls_schannel.cpp.

References schannelCipherInfo.

Referenced by cryptoSettingsForCiphers().

+ Here is the caller graph for this function:

◆ ciphersByName()

QList< QSslCipher > QTlsPrivate::ciphersByName ( QStringView schannelSuiteName)

Definition at line 395 of file qtls_schannel.cpp.

References QStringLiteral, QT_WARNING_DISABLE_DEPRECATED, QT_WARNING_POP, QT_WARNING_PUSH, schannelCipherInfo, QSsl::TlsV1_2, and QSsl::TlsV1_3.

Referenced by defaultCiphers(), and QTlsPrivate::TlsCryptographSchannel::sessionCipher().

+ Here is the caller graph for this function:

◆ containsTls13Cipher()

bool QTlsPrivate::containsTls13Cipher ( const QList< QSslCipher > & ciphers)

Definition at line 459 of file qtls_schannel.cpp.

◆ cryptoSettingsForCiphers()

QList< CRYPTO_SETTINGS > QTlsPrivate::cryptoSettingsForCiphers ( const QList< QSslCipher > & ciphers)

Determines which algorithms are not used by the requested ciphers to build up a black list that can be passed to SCH_CREDENTIALS.

Definition at line 233 of file qtls_schannel.cpp.

References BCRYPT_ECDH_ALGORITHM, BCRYPT_ECDSA_ALGORITHM, cbcChainingMode, characters, cipherInfoByOpenSslName(), QLatin1StringView::contains(), defaultCiphers(), gcmChainingMode, info, method, and settings.

+ Here is the call graph for this function:

◆ defaultCiphers()

QList< QSslCipher > QTlsPrivate::defaultCiphers ( )

Definition at line 425 of file qtls_schannel.cpp.

References ciphersByName(), qCWarning, and QSsl::TlsV1_3.

Referenced by cryptoSettingsForCiphers().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doCrypt()

QByteArray QTlsPrivate::doCrypt ( QSslKeyPrivate::Cipher cipher,
const QByteArray & data,
const QByteArray & key,
const QByteArray & iv,
bool enc )

Definition at line 411 of file qtlskey_openssl.cpp.

References Aes128Cbc, Aes192Cbc, Aes256Cbc, DesCbc, DesEde3Cbc, i, QTlsBackendOpenSSL::logAndClearErrorQueue(), output, q_EVP_aes_128_cbc(), q_EVP_aes_192_cbc(), q_EVP_aes_256_cbc(), q_EVP_CIPHER_CTX_ctrl(), q_EVP_CIPHER_CTX_free(), q_EVP_CIPHER_CTX_new(), q_EVP_CIPHER_CTX_reset(), q_EVP_CIPHER_CTX_set_key_length(), q_EVP_CipherFinal(), q_EVP_CipherInit(), q_EVP_CipherInit_ex(), q_EVP_CipherUpdate(), q_EVP_des_cbc(), q_EVP_des_ede3_cbc(), q_EVP_rc2_cbc(), and Rc2Cbc.

Referenced by QTlsPrivate::TlsKeyOpenSSL::decrypt(), QTlsPrivate::TlsKeySchannel::decrypt(), QTlsPrivate::TlsKeyOpenSSL::encrypt(), and QTlsPrivate::TlsKeySchannel::encrypt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchSslCertificateData()

QList< QByteArray > QTlsPrivate::fetchSslCertificateData ( )

Definition at line 28 of file qsslsocket_openssl_android.cpp.

References i, and QByteArray().

Referenced by systemCaCertificates().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Q_GLOBAL_STATIC_WITH_ARGS()

◆ q_ssl_psk_client_callback()

static unsigned QTlsPrivate::q_ssl_psk_client_callback ( SSL * ssl,
const char * hint,
char * identity,
unsigned max_identity_len,
unsigned char * psk,
unsigned max_psk_len )
static

Definition at line 212 of file qtls_openssl.cpp.

References hint(), QTlsPrivate::TlsCryptographOpenSSL::pskClientTlsCallback(), q_SSL_get_ex_data(), and QTlsBackendOpenSSL::s_indexForSSLExtraData.

+ Here is the call graph for this function:

◆ q_ssl_psk_server_callback()

static unsigned int QTlsPrivate::q_ssl_psk_server_callback ( SSL * ssl,
const char * identity,
unsigned char * psk,
unsigned int max_psk_len )
static

Definition at line 219 of file qtls_openssl.cpp.

References Q_ASSERT, q_SSL_get_ex_data(), and QTlsBackendOpenSSL::s_indexForSSLExtraData.

+ Here is the call graph for this function:

◆ q_X509Callback()

int QTlsPrivate::q_X509Callback ( int ok,
X509_STORE_CTX * ctx )

◆ q_X509CallbackDirect()

int QTlsPrivate::q_X509CallbackDirect ( int ok,
X509_STORE_CTX * ctx )

Definition at line 172 of file qtls_openssl.cpp.

References ok, q_SSL_get_ex_data(), q_SSL_get_ex_data_X509_STORE_CTX_idx(), q_X509_STORE_CTX_get_ex_data(), qCWarning, QTlsBackendOpenSSL::s_indexForSSLExtraData, and QTlsPrivate::TlsCryptographOpenSSL::socketOffsetInExData.

+ Here is the call graph for this function:

◆ QSslCipher_from_SSLCipherSuite()

QSslCipher QTlsPrivate::QSslCipher_from_SSLCipherSuite ( SSLCipherSuite cipher)

Definition at line 26 of file qtlsbackend_st.cpp.

References QSslCipher_from_SSLCipherSuite(), and QSsl::TlsV1_2.

Referenced by QSecureTransportBackend::ensureInitialized(), QSslCipher_from_SSLCipherSuite(), and QTlsPrivate::TlsCryptographSecureTransport::sessionCipher().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_AlertInfoCallback()

void QTlsPrivate::qt_AlertInfoCallback ( const SSL * connection,
int from,
int value )

Definition at line 327 of file qtls_openssl.cpp.

References connection, q_SSL_get_ex_data(), qCWarning, QTlsBackendOpenSSL::s_indexForSSLExtraData, and QTlsPrivate::TlsCryptographOpenSSL::socketOffsetInExData.

Referenced by QTlsPrivate::TlsCryptographOpenSSL::startHandshake().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ qt_createSecureTransportContext()

SSLContextRef QTlsPrivate::qt_createSecureTransportContext ( QSslSocket::SslMode mode)

Definition at line 166 of file qtls_st.cpp.

References context, qCWarning, and QSslSocket::SslServerMode.

Referenced by QSecureTransportBackend::ensureInitialized().

+ Here is the caller graph for this function:

◆ qt_X509Callback()

int QTlsPrivate::qt_X509Callback ( int ok,
X509_STORE_CTX * ctx )

Definition at line 355 of file qx509_openssl.cpp.

References QTlsPrivate::X509CertificateOpenSSL::errorEntryFromStoreContext(), QTlsPrivate::TlsCryptographOpenSSL::errorOffsetInExData, ok, q_SSL_get_ex_data(), q_SSL_get_ex_data_X509_STORE_CTX_idx(), q_X509_STORE_CTX_get0_store(), q_X509_STORE_CTX_get_ex_data(), q_X509_STORE_get_ex_data(), qCWarning, and QTlsBackendOpenSSL::s_indexForSSLExtraData.

Referenced by QTlsPrivate::X509CertificateOpenSSL::verify().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ systemCaCertificates()

QList< QSslCertificate > QTlsPrivate::systemCaCertificates ( )

Definition at line 357 of file qtlsbackend_openssl.cpp.

References cert, QSsl::Der, directory, fetchSslCertificateData(), file, QSslCertificate::fromData(), QSslCertificate::fromPath(), QSsl::Pem, qCDebug, QStringLiteral, QDir::setNameFilters(), QDir::setPath(), QTimer::start(), timer, and QSslSocketPrivate::unixRootCertDirectories().

Referenced by QTlsBackendOpenSSL::systemCaCertificates(), and QSecureTransportBackend::systemCaCertificates().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ cbcChainingMode

UNICODE_STRING QTlsPrivate::cbcChainingMode
Initial value:
= {
sizeof(BCRYPT_CHAIN_MODE_CBC) - 2,
sizeof(BCRYPT_CHAIN_MODE_CBC),
const_cast<PWSTR>(BCRYPT_CHAIN_MODE_CBC)
}

Definition at line 217 of file qtls_schannel.cpp.

Referenced by cryptoSettingsForCiphers().

◆ dhparam

const uint8_t QTlsPrivate::dhparam[]
static
Initial value:
=
"\x30\x82\x01\x08\x02\x82\x01\x01\x00\x97\xea\xd0\x46\xf7\xae\xa7\x76\x80"
"\x9c\x74\x56\x98\xd8\x56\x97\x2b\x20\x6c\x77\xe2\x82\xbb\xc8\x84\xbe\xe7"
"\x63\xaf\xcc\x30\xd0\x67\x97\x7d\x1b\xab\x59\x30\xa9\x13\x67\x21\xd7\xd4"
"\x0e\x46\xcf\xe5\x80\xdf\xc9\xb9\xba\x54\x9b\x46\x2f\x3b\x45\xfc\x2f\xaf"
"\xad\xc0\x17\x56\xdd\x52\x42\x57\x45\x70\x14\xe5\xbe\x67\xaa\xde\x69\x75"
"\x30\x0d\xf9\xa2\xc4\x63\x4d\x7a\x39\xef\x14\x62\x18\x33\x44\xa1\xf9\xc1"
"\x52\xd1\xb6\x72\x21\x98\xf8\xab\x16\x1b\x7b\x37\x65\xe3\xc5\x11\x00\xf6"
"\x36\x1f\xd8\x5f\xd8\x9f\x43\xa8\xce\x9d\xbf\x5e\xd6\x2d\xfa\x0a\xc2\x01"
"\x54\xc2\xd9\x81\x54\x55\xb5\x26\xf8\x88\x37\xf5\xfe\xe0\xef\x4a\x34\x81"
"\xdc\x5a\xb3\x71\x46\x27\xe3\xcd\x24\xf6\x1b\xf1\xe2\x0f\xc2\xa1\x39\x53"
"\x5b\xc5\x38\x46\x8e\x67\x4c\xd9\xdd\xe4\x37\x06\x03\x16\xf1\x1d\x7a\xba"
"\x2d\xc1\xe4\x03\x1a\x58\xe5\x29\x5a\x29\x06\x69\x61\x7a\xd8\xa9\x05\x9f"
"\xc1\xa2\x45\x9c\x17\xad\x52\x69\x33\xdc\x18\x8d\x15\xa6\x5e\xcd\x94\xf4"
"\x45\xbb\x9f\xc2\x7b\x85\x00\x61\xb0\x1a\xdc\x3c\x86\xaa\x9f\x5c\x04\xb3"
"\x90\x0b\x35\x64\xff\xd9\xe3\xac\xf2\xf2\xeb\x3a\x63\x02\x01\x02"

Definition at line 199 of file qtls_st.cpp.

◆ gcmChainingMode

UNICODE_STRING QTlsPrivate::gcmChainingMode
Initial value:
= {
sizeof(BCRYPT_CHAIN_MODE_GCM) - 2,
sizeof(BCRYPT_CHAIN_MODE_GCM),
const_cast<PWSTR>(BCRYPT_CHAIN_MODE_GCM)
}

Definition at line 223 of file qtls_schannel.cpp.

Referenced by cryptoSettingsForCiphers().

◆ schannelCipherInfo

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

Definition at line 155 of file qtls_schannel.cpp.

Referenced by cipherInfoByOpenSslName(), and ciphersByName().