From 80dd3a8f85f705995d6d9ed871fc80eab9e0a40a Mon Sep 17 00:00:00 2001 From: David Rosca Date: Mon, 12 Jan 2015 21:11:12 +0100 Subject: [PATCH] Revert "Add option to completely disable SSLv3" This reverts commit a640948c3ba80c54b64b051629b8e7834fd3b382. QSsl::SecureProtocols is default value and it already disables SSLv3 in Qt 5 Closes #1579 --- src/lib/network/networkmanager.cpp | 40 +++--------------------------- src/lib/network/networkmanager.h | 5 ---- src/lib/preferences/sslmanager.cpp | 7 ------ src/lib/preferences/sslmanager.h | 1 - src/lib/preferences/sslmanager.ui | 33 ++++++++++-------------- 5 files changed, 16 insertions(+), 70 deletions(-) diff --git a/src/lib/network/networkmanager.cpp b/src/lib/network/networkmanager.cpp index e070d0eb3..649728917 100644 --- a/src/lib/network/networkmanager.cpp +++ b/src/lib/network/networkmanager.cpp @@ -73,7 +73,6 @@ NetworkManager::NetworkManager(QObject* parent) , m_adblockManager(0) , m_ignoreAllWarnings(false) , m_disableWeakCiphers(true) - , m_disableSSLv3(true) { connect(this, SIGNAL(authenticationRequired(QNetworkReply*,QAuthenticator*)), this, SLOT(authentication(QNetworkReply*,QAuthenticator*))); connect(this, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), this, SLOT(proxyAuthentication(QNetworkProxy,QAuthenticator*))); @@ -177,27 +176,6 @@ void NetworkManager::disableWeakCiphers(bool disable) } } -void NetworkManager::disableSSLv3(bool disable) -{ - QSsl::SslProtocol tlsProtocol; - QSsl::SslProtocol defaultProtocol; - -#if QT_VERSION < QT_VERSION_CHECK(4,8,0) - tlsProtocol = QSsl::TlsV1; - defaultProtocol = QSsl::SslV3; -#elif QT_VERSION < QT_VERSION_CHECK(5,0,0) - tlsProtocol = QSsl::TlsV1; - defaultProtocol = QSsl::TlsV1SslV3; -#else - tlsProtocol = QSsl::TlsV1_0; - defaultProtocol = QSsl::TlsV1SslV3; -#endif - - QSslConfiguration config = QSslConfiguration::defaultConfiguration(); - config.setProtocol(disable ? tlsProtocol : defaultProtocol); - QSslConfiguration::setDefaultConfiguration(config); -} - static inline uint qHash(const QSslCertificate &cert) { return qHash(cert.toPem()); @@ -702,18 +680,6 @@ void NetworkManager::setDisableWeakCiphers(bool state) Settings().setValue("SSL-Configuration/DisableWeakCiphers", m_disableWeakCiphers); } -bool NetworkManager::isDisablingSSLv3() const -{ - return m_disableSSLv3; -} - -void NetworkManager::setDisableSSLv3(bool state) -{ - m_disableSSLv3 = state; - disableSSLv3(m_disableSSLv3); - Settings().setValue("SSL-Configuration/DisableSSLv3", m_disableSSLv3); -} - NetworkProxyFactory* NetworkManager::proxyFactory() const { return m_proxyFactory; @@ -745,7 +711,9 @@ void NetworkManager::saveSettings() settings.setValue("CACertPaths", m_certPaths); settings.setValue("IgnoreAllSSLWarnings", m_ignoreAllWarnings); settings.setValue("DisableWeakCiphers", m_disableWeakCiphers); - settings.setValue("DisableSSLv3", m_disableSSLv3); + settings.endGroup(); + + settings.beginGroup("Web-Browser-Settings"); settings.endGroup(); } @@ -756,11 +724,9 @@ void NetworkManager::loadCertificates() m_certPaths = settings.value("CACertPaths", QStringList()).toStringList(); m_ignoreAllWarnings = settings.value("IgnoreAllSSLWarnings", false).toBool(); m_disableWeakCiphers = settings.value("DisableWeakCiphers", true).toBool(); - m_disableSSLv3 = settings.value("DisableSSLv3", true).toBool(); settings.endGroup(); disableWeakCiphers(m_disableWeakCiphers); - disableSSLv3(m_disableSSLv3); // CA Certificates m_caCerts = QSslSocket::defaultCaCertificates(); diff --git a/src/lib/network/networkmanager.h b/src/lib/network/networkmanager.h index 69c5dde64..d84add6cb 100644 --- a/src/lib/network/networkmanager.h +++ b/src/lib/network/networkmanager.h @@ -55,9 +55,6 @@ public: bool isDisablingWeakCiphers() const; void setDisableWeakCiphers(bool state); - bool isDisablingSSLv3() const; - void setDisableSSLv3(bool state); - NetworkProxyFactory* proxyFactory() const; bool registerSchemeHandler(const QString &scheme, SchemeHandler* handler); @@ -75,7 +72,6 @@ private slots: private: void disableWeakCiphers(bool disable); - void disableSSLv3(bool disable); AdBlockManager* m_adblockManager; NetworkProxyFactory* m_proxyFactory; @@ -90,7 +86,6 @@ private: bool m_ignoreAllWarnings; bool m_disableWeakCiphers; - bool m_disableSSLv3; bool m_doNotTrack; bool m_sendReferer; }; diff --git a/src/lib/preferences/sslmanager.cpp b/src/lib/preferences/sslmanager.cpp index b3570e5ae..17638ba93 100644 --- a/src/lib/preferences/sslmanager.cpp +++ b/src/lib/preferences/sslmanager.cpp @@ -52,13 +52,11 @@ SSLManager::SSLManager(QWidget* parent) connect(ui->deletePath, SIGNAL(clicked()), this, SLOT(deletePath())); connect(ui->ignoreAll, SIGNAL(clicked(bool)), this, SLOT(ignoreAll(bool))); connect(ui->disableWeakCiphers, SIGNAL(clicked(bool)), this, SLOT(disableWeakCiphers(bool))); - connect(ui->disableSSLv3, SIGNAL(clicked(bool)), this, SLOT(disableSSLv3(bool))); connect(ui->buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(close())); // Settings ui->disableWeakCiphers->setChecked(mApp->networkManager()->isDisablingWeakCiphers()); - ui->disableSSLv3->setChecked(mApp->networkManager()->isDisablingSSLv3()); ui->ignoreAll->setChecked(mApp->networkManager()->isIgnoringAllWarnings()); } @@ -202,11 +200,6 @@ void SSLManager::disableWeakCiphers(bool state) mApp->networkManager()->setDisableWeakCiphers(state); } -void SSLManager::disableSSLv3(bool state) -{ - mApp->networkManager()->setDisableSSLv3(state); -} - void SSLManager::closeEvent(QCloseEvent* e) { QStringList paths; diff --git a/src/lib/preferences/sslmanager.h b/src/lib/preferences/sslmanager.h index 8345cae15..222273510 100644 --- a/src/lib/preferences/sslmanager.h +++ b/src/lib/preferences/sslmanager.h @@ -44,7 +44,6 @@ private slots: void deleteCertificate(); void ignoreAll(bool state); void disableWeakCiphers(bool state); - void disableSSLv3(bool state); void addPath(); void deletePath(); diff --git a/src/lib/preferences/sslmanager.ui b/src/lib/preferences/sslmanager.ui index 5b56df2f2..27d5911db 100644 --- a/src/lib/preferences/sslmanager.ui +++ b/src/lib/preferences/sslmanager.ui @@ -172,21 +172,7 @@ - - - - Ignore all SSL Warnings - - - - - - - Disable weak ciphers - - - - + <b>NOTE:</b> Setting this option is a high security risk! @@ -196,7 +182,7 @@ - + Qt::Horizontal @@ -212,7 +198,7 @@ - + Qt::Horizontal @@ -225,10 +211,17 @@ - - + + - Disable SSLv3 + Ignore all SSL Warnings + + + + + + + Disable weak ciphers