From 2d2c18effc1f00fb5e3f5e1ee51bf817bbbe53a4 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 15 Jun 2020 14:28:50 +0200 Subject: [PATCH] QSslSocket: delete deprecated cipher settings API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I439ea567b9a4add3eb205335420810d88b580b20 Reviewed-by: MÃ¥rten Nordheim --- src/network/ssl/qsslsocket.cpp | 146 --------------------------------- src/network/ssl/qsslsocket.h | 10 --- 2 files changed, 156 deletions(-) diff --git a/src/network/ssl/qsslsocket.cpp b/src/network/ssl/qsslsocket.cpp index e4627eba68..ab1f2b0dc8 100644 --- a/src/network/ssl/qsslsocket.cpp +++ b/src/network/ssl/qsslsocket.cpp @@ -1377,152 +1377,6 @@ QSslKey QSslSocket::privateKey() const return d->configuration.privateKey; } -#if QT_DEPRECATED_SINCE(5, 5) -/*! - \deprecated - - Use QSslConfiguration::ciphers() instead. - - Returns this socket's current cryptographic cipher suite. This - list is used during the socket's handshake phase for choosing a - session cipher. The returned list of ciphers is ordered by - descending preference. (i.e., the first cipher in the list is the - most preferred cipher). The session cipher will be the first one - in the list that is also supported by the peer. - - By default, the handshake phase can choose any of the ciphers - supported by this system's SSL libraries, which may vary from - system to system. The list of ciphers supported by this system's - SSL libraries is returned by supportedCiphers(). You can restrict - the list of ciphers used for choosing the session cipher for this - socket by calling setCiphers() with a subset of the supported - ciphers. You can revert to using the entire set by calling - setCiphers() with the list returned by supportedCiphers(). - - You can restrict the list of ciphers used for choosing the session - cipher for \e all sockets by calling setDefaultCiphers() with a - subset of the supported ciphers. You can revert to using the - entire set by calling setCiphers() with the list returned by - supportedCiphers(). - - \sa setCiphers(), defaultCiphers(), setDefaultCiphers(), supportedCiphers() -*/ -QList QSslSocket::ciphers() const -{ - Q_D(const QSslSocket); - return d->configuration.ciphers; -} - -/*! - \deprecated - - USe QSslConfiguration::setCiphers() instead. - - Sets the cryptographic cipher suite for this socket to \a ciphers, - which must contain a subset of the ciphers in the list returned by - supportedCiphers(). - - Restricting the cipher suite must be done before the handshake - phase, where the session cipher is chosen. - - \sa ciphers(), setDefaultCiphers(), supportedCiphers() -*/ -void QSslSocket::setCiphers(const QList &ciphers) -{ - Q_D(QSslSocket); - d->configuration.ciphers = ciphers; -} - -/*! - \deprecated - - Use QSslConfiguration::setCiphers() instead. - - Sets the cryptographic cipher suite for this socket to \a ciphers, which - is a colon-separated list of cipher suite names. The ciphers are listed in - order of preference, starting with the most preferred cipher. For example: - - \snippet code/src_network_ssl_qsslsocket.cpp 4 - - Each cipher name in \a ciphers must be the name of a cipher in the - list returned by supportedCiphers(). Restricting the cipher suite - must be done before the handshake phase, where the session cipher - is chosen. - - \sa ciphers(), setDefaultCiphers(), supportedCiphers() -*/ -void QSslSocket::setCiphers(const QString &ciphers) -{ - Q_D(QSslSocket); - d->configuration.ciphers.clear(); - const auto cipherNames = ciphers.split(QLatin1Char(':'), Qt::SkipEmptyParts); - for (const QString &cipherName : cipherNames) { - QSslCipher cipher(cipherName); - if (!cipher.isNull()) - d->configuration.ciphers << cipher; - } -} - -/*! - \deprecated - - Use QSslConfiguration::setCiphers() on the default QSslConfiguration instead. - - Sets the default cryptographic cipher suite for all sockets in - this application to \a ciphers, which must contain a subset of the - ciphers in the list returned by supportedCiphers(). - - Restricting the default cipher suite only affects SSL sockets - that perform their handshake phase after the default cipher - suite has been changed. - - \sa setCiphers(), defaultCiphers(), supportedCiphers() -*/ -void QSslSocket::setDefaultCiphers(const QList &ciphers) -{ - QSslSocketPrivate::setDefaultCiphers(ciphers); -} - -/*! - \deprecated - - Use QSslConfiguration::ciphers() on the default QSslConfiguration instead. - - Returns the default cryptographic cipher suite for all sockets in - this application. This list is used during the socket's handshake - phase when negotiating with the peer to choose a session cipher. - The list is ordered by preference (i.e., the first cipher in the - list is the most preferred cipher). - - By default, the handshake phase can choose any of the ciphers - supported by this system's SSL libraries, which may vary from - system to system. The list of ciphers supported by this system's - SSL libraries is returned by supportedCiphers(). - - \sa supportedCiphers() -*/ -QList QSslSocket::defaultCiphers() -{ - return QSslSocketPrivate::defaultCiphers(); -} - -/*! - \deprecated - - Use QSslConfiguration::supportedCiphers() instead. - - Returns the list of cryptographic ciphers supported by this - system. This list is set by the system's SSL libraries and may - vary from system to system. - - \sa defaultCiphers(), ciphers(), setCiphers() -*/ -QList QSslSocket::supportedCiphers() -{ - return QSslSocketPrivate::supportedCiphers(); -} -#endif // #if QT_DEPRECATED_SINCE(5, 5) - /*! \deprecated diff --git a/src/network/ssl/qsslsocket.h b/src/network/ssl/qsslsocket.h index e7e24ef246..a091828638 100644 --- a/src/network/ssl/qsslsocket.h +++ b/src/network/ssl/qsslsocket.h @@ -196,16 +196,6 @@ public: const QByteArray &passPhrase = QByteArray()); QSslKey privateKey() const; - // Cipher settings. -#if QT_DEPRECATED_SINCE(5, 5) - QT_DEPRECATED_X("Use QSslConfiguration::ciphers()") QList ciphers() const; - QT_DEPRECATED_X("Use QSslConfiguration::setCiphers()") void setCiphers(const QList &ciphers); - QT_DEPRECATED void setCiphers(const QString &ciphers); - QT_DEPRECATED static void setDefaultCiphers(const QList &ciphers); - QT_DEPRECATED static QList defaultCiphers(); - QT_DEPRECATED_X("Use QSslConfiguration::supportedCiphers()") static QList supportedCiphers(); -#endif // QT_DEPRECATED_SINCE(5, 5) - // CA settings. #if QT_DEPRECATED_SINCE(5, 15) QT_DEPRECATED_X("Use QSslConfiguration::addCaCertificate()") void addCaCertificate(const QSslCertificate &certificate);