summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslsocket_openssl.cpp
diff options
context:
space:
mode:
authorMÃ¥rten Nordheim <marten.nordheim@qt.io>2018-08-07 10:29:46 +0200
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2018-08-09 05:34:51 +0000
commit89d4c600a512d9aea35bb4d763e43fe81b138824 (patch)
tree8d2d0fc816b940ea6a17c42c3153aff7464fddd7 /src/network/ssl/qsslsocket_openssl.cpp
parentc1117ac496df9f7e47fdc82306bb4e20848a04d4 (diff)
Ssl: clang-tidy modernize-use-nullptr
And reflow the text where it exceeds the 100 column limit. Change-Id: I0d270c6a74a4c6ecba30e4e4d38a5d8f2cf81040 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/network/ssl/qsslsocket_openssl.cpp')
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/network/ssl/qsslsocket_openssl.cpp b/src/network/ssl/qsslsocket_openssl.cpp
index 038d32ae13..ba02d13863 100644
--- a/src/network/ssl/qsslsocket_openssl.cpp
+++ b/src/network/ssl/qsslsocket_openssl.cpp
@@ -88,9 +88,9 @@
QT_BEGIN_NAMESPACE
#if defined(Q_OS_WIN)
- PtrCertOpenSystemStoreW QSslSocketPrivate::ptrCertOpenSystemStoreW = 0;
- PtrCertFindCertificateInStore QSslSocketPrivate::ptrCertFindCertificateInStore = 0;
- PtrCertCloseStore QSslSocketPrivate::ptrCertCloseStore = 0;
+ PtrCertOpenSystemStoreW QSslSocketPrivate::ptrCertOpenSystemStoreW = nullptr;
+ PtrCertFindCertificateInStore QSslSocketPrivate::ptrCertFindCertificateInStore = nullptr;
+ PtrCertCloseStore QSslSocketPrivate::ptrCertCloseStore = nullptr;
#endif
bool QSslSocketPrivate::s_libraryLoaded = false;
@@ -140,10 +140,10 @@ static unsigned int q_ssl_psk_server_callback(SSL *ssl,
} // extern "C"
QSslSocketBackendPrivate::QSslSocketBackendPrivate()
- : ssl(0),
- readBio(0),
- writeBio(0),
- session(0)
+ : ssl(nullptr),
+ readBio(nullptr),
+ writeBio(nullptr),
+ session(nullptr)
{
// Calls SSL_library_init().
ensureInitialized();
@@ -415,7 +415,7 @@ void QSslSocketBackendPrivate::destroySslContext()
{
if (ssl) {
q_SSL_free(ssl);
- ssl = 0;
+ ssl = nullptr;
}
sslContextPointer.clear();
}
@@ -1350,7 +1350,7 @@ QList<QSslError> QSslSocketBackendPrivate::verify(const QList<QSslCertificate> &
q_X509_STORE_set_verify_cb(certStore, q_X509Callback);
// Build the chain of intermediate certificates
- STACK_OF(X509) *intermediates = 0;
+ STACK_OF(X509) *intermediates = nullptr;
if (certificateChain.length() > 1) {
intermediates = (STACK_OF(X509) *) q_OPENSSL_sk_new_null();
@@ -1443,9 +1443,10 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
BIO *bio = q_BIO_new_mem_buf(const_cast<char *>(pkcs12data.constData()), pkcs12data.size());
// Create the PKCS#12 object
- PKCS12 *p12 = q_d2i_PKCS12_bio(bio, 0);
+ PKCS12 *p12 = q_d2i_PKCS12_bio(bio, nullptr);
if (!p12) {
- qCWarning(lcSsl, "Unable to read PKCS#12 structure, %s", q_ERR_error_string(q_ERR_get_error(), 0));
+ qCWarning(lcSsl, "Unable to read PKCS#12 structure, %s",
+ q_ERR_error_string(q_ERR_get_error(), nullptr));
q_BIO_free(bio);
return false;
}
@@ -1453,10 +1454,11 @@ bool QSslSocketBackendPrivate::importPkcs12(QIODevice *device,
// Extract the data
EVP_PKEY *pkey = nullptr;
X509 *x509;
- STACK_OF(X509) *ca = 0;
+ STACK_OF(X509) *ca = nullptr;
if (!q_PKCS12_parse(p12, passPhrase.constData(), &pkey, &x509, &ca)) {
- qCWarning(lcSsl, "Unable to parse PKCS#12 structure, %s", q_ERR_error_string(q_ERR_get_error(), 0));
+ qCWarning(lcSsl, "Unable to parse PKCS#12 structure, %s",
+ q_ERR_error_string(q_ERR_get_error(), nullptr));
q_PKCS12_free(p12);
q_BIO_free(bio);
return false;