diff options
Diffstat (limited to 'src/network/ssl')
-rw-r--r-- | src/network/ssl/qsslcertificate.cpp | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslcertificate.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslcertificateextension.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslcipher.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslconfiguration.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslerror.cpp | 1 | ||||
-rw-r--r-- | src/network/ssl/qsslerror.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslkey.h | 5 | ||||
-rw-r--r-- | src/network/ssl/qsslkey_p.cpp | 22 | ||||
-rw-r--r-- | src/network/ssl/qsslkey_qt.cpp | 5 | ||||
-rw-r--r-- | src/network/ssl/qsslpresharedkeyauthenticator.h | 2 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket.cpp | 12 | ||||
-rw-r--r-- | src/network/ssl/qsslsocket_openssl_symbols.cpp | 2 |
13 files changed, 35 insertions, 26 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp index 0156b5bf96..4820953468 100644 --- a/src/network/ssl/qsslcertificate.cpp +++ b/src/network/ssl/qsslcertificate.cpp @@ -417,7 +417,7 @@ QByteArray QSslCertificate::digest(QCryptographicHash::Algorithm algorithm) cons /*! \fn Qt::HANDLE QSslCertificate::handle() const Returns a pointer to the native certificate handle, if there is - one, or a null pointer otherwise. + one, else \nullptr. You can use this handle, together with the native API, to access extended information about the certificate. diff --git a/src/network/ssl/qsslcertificate.h b/src/network/ssl/qsslcertificate.h index a6acfa2cc3..69901b526c 100644 --- a/src/network/ssl/qsslcertificate.h +++ b/src/network/ssl/qsslcertificate.h @@ -88,9 +88,7 @@ public: explicit QSslCertificate(const QByteArray &data = QByteArray(), QSsl::EncodingFormat format = QSsl::Pem); QSslCertificate(const QSslCertificate &other); ~QSslCertificate(); -#ifdef Q_COMPILER_RVALUE_REFS QSslCertificate &operator=(QSslCertificate &&other) noexcept { swap(other); return *this; } -#endif QSslCertificate &operator=(const QSslCertificate &other); void swap(QSslCertificate &other) noexcept diff --git a/src/network/ssl/qsslcertificateextension.h b/src/network/ssl/qsslcertificateextension.h index f862015312..7cc8a888be 100644 --- a/src/network/ssl/qsslcertificateextension.h +++ b/src/network/ssl/qsslcertificateextension.h @@ -55,9 +55,7 @@ class Q_NETWORK_EXPORT QSslCertificateExtension public: QSslCertificateExtension(); QSslCertificateExtension(const QSslCertificateExtension &other); -#ifdef Q_COMPILER_RVALUE_REFS QSslCertificateExtension &operator=(QSslCertificateExtension &&other) noexcept { swap(other); return *this; } -#endif QSslCertificateExtension &operator=(const QSslCertificateExtension &other); ~QSslCertificateExtension(); diff --git a/src/network/ssl/qsslcipher.h b/src/network/ssl/qsslcipher.h index 430fe9aa7c..6994f590ae 100644 --- a/src/network/ssl/qsslcipher.h +++ b/src/network/ssl/qsslcipher.h @@ -59,9 +59,7 @@ public: explicit QSslCipher(const QString &name); QSslCipher(const QString &name, QSsl::SslProtocol protocol); QSslCipher(const QSslCipher &other); -#ifdef Q_COMPILER_RVALUE_REFS QSslCipher &operator=(QSslCipher &&other) noexcept { swap(other); return *this; } -#endif QSslCipher &operator=(const QSslCipher &other); ~QSslCipher(); diff --git a/src/network/ssl/qsslconfiguration.h b/src/network/ssl/qsslconfiguration.h index 16704ba17b..c25c2686de 100644 --- a/src/network/ssl/qsslconfiguration.h +++ b/src/network/ssl/qsslconfiguration.h @@ -85,9 +85,7 @@ public: QSslConfiguration(); QSslConfiguration(const QSslConfiguration &other); ~QSslConfiguration(); -#ifdef Q_COMPILER_RVALUE_REFS QSslConfiguration &operator=(QSslConfiguration &&other) noexcept { swap(other); return *this; } -#endif QSslConfiguration &operator=(const QSslConfiguration &other); void swap(QSslConfiguration &other) noexcept diff --git a/src/network/ssl/qsslerror.cpp b/src/network/ssl/qsslerror.cpp index ff54c2ad20..3e822fe852 100644 --- a/src/network/ssl/qsslerror.cpp +++ b/src/network/ssl/qsslerror.cpp @@ -86,6 +86,7 @@ \value UnspecifiedError \value NoSslSupport \value CertificateBlacklisted + \value CertificateStatusUnknown \value OcspNoResponseFound \value OcspMalformedRequest \value OcspMalformedResponse diff --git a/src/network/ssl/qsslerror.h b/src/network/ssl/qsslerror.h index a9c46c8571..c4a0d52193 100644 --- a/src/network/ssl/qsslerror.h +++ b/src/network/ssl/qsslerror.h @@ -107,9 +107,7 @@ public: { qSwap(d, other.d); } ~QSslError(); -#ifdef Q_COMPILER_RVALUE_REFS QSslError &operator=(QSslError &&other) noexcept { swap(other); return *this; } -#endif QSslError &operator=(const QSslError &other); bool operator==(const QSslError &other) const; inline bool operator!=(const QSslError &other) const diff --git a/src/network/ssl/qsslkey.h b/src/network/ssl/qsslkey.h index a865f20a51..74be406539 100644 --- a/src/network/ssl/qsslkey.h +++ b/src/network/ssl/qsslkey.h @@ -71,9 +71,8 @@ public: const QByteArray &passPhrase = QByteArray()); explicit QSslKey(Qt::HANDLE handle, QSsl::KeyType type = QSsl::PrivateKey); QSslKey(const QSslKey &other); -#ifdef Q_COMPILER_RVALUE_REFS - QSslKey &operator=(QSslKey &&other) noexcept { swap(other); return *this; } -#endif + QSslKey(QSslKey &&other) noexcept; + QSslKey &operator=(QSslKey &&other) noexcept; QSslKey &operator=(const QSslKey &other); ~QSslKey(); diff --git a/src/network/ssl/qsslkey_p.cpp b/src/network/ssl/qsslkey_p.cpp index b29b38beab..b0d6c729f9 100644 --- a/src/network/ssl/qsslkey_p.cpp +++ b/src/network/ssl/qsslkey_p.cpp @@ -385,6 +385,24 @@ QSslKey::QSslKey(const QSslKey &other) : d(other.d) { } +QSslKey::QSslKey(QSslKey &&other) noexcept + : d(nullptr) +{ + qSwap(d, other.d); +} + +QSslKey &QSslKey::operator=(QSslKey &&other) noexcept +{ + if (this == &other) + return *this; + + // If no one else is referencing the key data we want to make sure + // before we swap the d-ptr that it is not left in memory. + d.reset(); + qSwap(d, other.d); + return *this; +} + /*! Destroys the QSslKey object. */ @@ -490,8 +508,8 @@ QByteArray QSslKey::toPem(const QByteArray &passPhrase) const } /*! - Returns a pointer to the native key handle, if it is available; - otherwise a null pointer is returned. + Returns a pointer to the native key handle, if there is + one, else \nullptr. You can use this handle together with the native API to access extended information about the key. diff --git a/src/network/ssl/qsslkey_qt.cpp b/src/network/ssl/qsslkey_qt.cpp index 2662418a05..43969c3d28 100644 --- a/src/network/ssl/qsslkey_qt.cpp +++ b/src/network/ssl/qsslkey_qt.cpp @@ -48,6 +48,8 @@ #include <QtNetwork/qpassworddigestor.h> +#include <cstring> + QT_USE_NAMESPACE static const quint8 bits_table[256] = { @@ -186,8 +188,9 @@ static QByteArray deriveKey(QSslKeyPrivate::Cipher cipher, const QByteArray &pas void QSslKeyPrivate::clear(bool deep) { - Q_UNUSED(deep); isNull = true; + if (deep) + std::memset(derData.data(), 0, derData.size()); derData.clear(); keyLength = -1; } diff --git a/src/network/ssl/qsslpresharedkeyauthenticator.h b/src/network/ssl/qsslpresharedkeyauthenticator.h index 29d647b121..5d714dc34e 100644 --- a/src/network/ssl/qsslpresharedkeyauthenticator.h +++ b/src/network/ssl/qsslpresharedkeyauthenticator.h @@ -59,9 +59,7 @@ public: Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator(const QSslPreSharedKeyAuthenticator &authenticator); Q_NETWORK_EXPORT QSslPreSharedKeyAuthenticator &operator=(const QSslPreSharedKeyAuthenticator &authenticator); -#ifdef Q_COMPILER_RVALUE_REFS QSslPreSharedKeyAuthenticator &operator=(QSslPreSharedKeyAuthenticator &&other) noexcept { swap(other); return *this; } -#endif void swap(QSslPreSharedKeyAuthenticator &other) noexcept { qSwap(d, other.d); } diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index 4e6caf3edd..fe81bd5fcf 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -761,8 +761,8 @@ qint64 QSslSocket::bytesAvailable() const { Q_D(const QSslSocket); if (d->mode == UnencryptedMode) - return QIODevice::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0); - return QIODevice::bytesAvailable(); + return QAbstractSocket::bytesAvailable() + (d->plainSocket ? d->plainSocket->bytesAvailable() : 0); + return QAbstractSocket::bytesAvailable(); } /*! @@ -818,8 +818,8 @@ bool QSslSocket::canReadLine() const { Q_D(const QSslSocket); if (d->mode == UnencryptedMode) - return QIODevice::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine()); - return QIODevice::canReadLine(); + return QAbstractSocket::canReadLine() || (d->plainSocket && d->plainSocket->canReadLine()); + return QAbstractSocket::canReadLine(); } /*! @@ -849,8 +849,8 @@ bool QSslSocket::atEnd() const { Q_D(const QSslSocket); if (d->mode == UnencryptedMode) - return QIODevice::atEnd() && (!d->plainSocket || d->plainSocket->atEnd()); - return QIODevice::atEnd(); + return QAbstractSocket::atEnd() && (!d->plainSocket || d->plainSocket->atEnd()); + return QAbstractSocket::atEnd(); } /*! diff --git a/src/network/ssl/qsslsocket_openssl_symbols.cpp b/src/network/ssl/qsslsocket_openssl_symbols.cpp index e04d45c10c..6f935a02e4 100644 --- a/src/network/ssl/qsslsocket_openssl_symbols.cpp +++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp @@ -693,7 +693,7 @@ static QStringList libraryPathList() // discover paths of already loaded libraries QSet<QString> loadedPaths; dl_iterate_phdr(dlIterateCallback, &loadedPaths); - paths.append(loadedPaths.toList()); + paths.append(loadedPaths.values()); #endif return paths; |