aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Krause <[email protected]>2017-08-19 14:20:21 +0200
committerVolker Krause <[email protected]>2017-08-21 18:27:15 +0200
commita53aed9673ccf5f52bffd16744b6aab02c667e02 (patch)
treeba5928af7ec5d98f234617182e5f69acd3b2c088
parent0448ce09767b1bb1b0e00b9775d3898e50f7e8b3 (diff)
Remove all traces of using Gravatar without transport security
Summary: This was effectively disabled in the UI already, but code that doesn't exist also can't accidentally be reactivated :) Reviewers: #kde_pim, mlaurent Reviewed By: #kde_pim, mlaurent Subscribers: mlaurent Tags: #kde_pim Differential Revision: https://phabricator.kde.org/D7408
-rw-r--r--CMakeLists.txt2
-rw-r--r--autotests/gravatardownloadpixmapwidgettest.cpp4
-rw-r--r--autotests/gravatarresolvurljobtest.cpp19
-rw-r--r--src/job/gravatarresolvurljob.cpp20
-rw-r--r--src/job/gravatarresolvurljob.h3
-rw-r--r--src/settings/gravatar.kcfg5
-rw-r--r--src/widgets/gravatarconfiguresettingsdialog.cpp2
-rw-r--r--src/widgets/gravatarconfiguresettingsdialog.h1
-rw-r--r--src/widgets/gravatardownloadpixmapwidget.cpp5
-rw-r--r--src/widgets/gravatardownloadpixmapwidget.h1
10 files changed, 10 insertions, 52 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab148b1..bccd0e9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.0)
-set(PIM_VERSION "5.6.40")
+set(PIM_VERSION "5.6.41")
project(gravatar VERSION ${PIM_VERSION})
diff --git a/autotests/gravatardownloadpixmapwidgettest.cpp b/autotests/gravatardownloadpixmapwidgettest.cpp
index 850dc00..1525c3d 100644
--- a/autotests/gravatardownloadpixmapwidgettest.cpp
+++ b/autotests/gravatardownloadpixmapwidgettest.cpp
@@ -57,10 +57,6 @@ void GravatarDownloadPixmapWidgetTest::shouldHaveDefaultValue()
QCheckBox *fallBackGravatar = w.findChild<QCheckBox *>(QStringLiteral("fallbackgravatar"));
QVERIFY(fallBackGravatar);
QVERIFY(!fallBackGravatar->isChecked());
-
- QCheckBox *useHttps = w.findChild<QCheckBox *>(QStringLiteral("usehttps"));
- QVERIFY(useHttps);
- QVERIFY(!useHttps->isChecked());
}
void GravatarDownloadPixmapWidgetTest::shouldChangeButtonEnableState()
diff --git a/autotests/gravatarresolvurljobtest.cpp b/autotests/gravatarresolvurljobtest.cpp
index 546240b..66bbd8d 100644
--- a/autotests/gravatarresolvurljobtest.cpp
+++ b/autotests/gravatarresolvurljobtest.cpp
@@ -41,7 +41,6 @@ void GravatarResolvUrlJobTest::shouldHaveDefaultValue()
QCOMPARE(job.useCache(), false);
QCOMPARE(job.useLibravatar(), false);
QCOMPARE(job.fallbackGravatar(), true);
- QVERIFY(!job.useHttps());
}
void GravatarResolvUrlJobTest::shouldChangeValue()
@@ -76,13 +75,6 @@ void GravatarResolvUrlJobTest::shouldChangeValue()
fallBackGravatar = true;
job.setFallbackGravatar(fallBackGravatar);
QCOMPARE(job.fallbackGravatar(), fallBackGravatar);
-
- bool useHttps = false;
- job.setUseHttps(useHttps);
- QCOMPARE(job.useHttps(), useHttps);
- useHttps = true;
- job.setUseHttps(useHttps);
- QCOMPARE(job.useHttps(), useHttps);
}
void GravatarResolvUrlJobTest::shouldChangeSize()
@@ -115,10 +107,10 @@ void GravatarResolvUrlJobTest::shouldAddSizeInUrl()
job.setSize(1024);
job.setUseLibravatar(false);
QUrl url = job.generateGravatarUrl(job.useLibravatar());
- QCOMPARE(url, QUrl(QStringLiteral("http://www.gravatar.com:80/avatar/89b4e14cf2fc6d426275c019c6dc9de6?d=404&s=1024")));
+ QCOMPARE(url, QUrl(QStringLiteral("https://secure.gravatar.com:443/avatar/89b4e14cf2fc6d426275c019c6dc9de6?d=404&s=1024")));
job.setUseLibravatar(true);
url = job.generateGravatarUrl(job.useLibravatar());
- QCOMPARE(url, QUrl(QStringLiteral("http://cdn.libravatar.org:80/avatar/2726400c3a33ce56c0ff632cbc0474f766d3b36e68819c601fb02954c1681d85?d=404&s=1024")));
+ QCOMPARE(url, QUrl(QStringLiteral("https://seccdn.libravatar.org:443/avatar/2726400c3a33ce56c0ff632cbc0474f766d3b36e68819c601fb02954c1681d85?d=404&s=1024")));
}
void GravatarResolvUrlJobTest::shouldUseDefaultPixmap()
@@ -128,7 +120,7 @@ void GravatarResolvUrlJobTest::shouldUseDefaultPixmap()
job.setSize(1024);
job.setUseDefaultPixmap(true);
QUrl url = job.generateGravatarUrl(job.useLibravatar());
- QCOMPARE(url, QUrl(QStringLiteral("http://www.gravatar.com:80/avatar/89b4e14cf2fc6d426275c019c6dc9de6?s=1024")));
+ QCOMPARE(url, QUrl(QStringLiteral("https://secure.gravatar.com:443/avatar/89b4e14cf2fc6d426275c019c6dc9de6?s=1024")));
}
void GravatarResolvUrlJobTest::shouldUseHttps()
@@ -137,7 +129,6 @@ void GravatarResolvUrlJobTest::shouldUseHttps()
job.setEmail(QStringLiteral("[email protected]"));
job.setSize(1024);
job.setUseLibravatar(false);
- job.setUseHttps(true);
QUrl url = job.generateGravatarUrl(job.useLibravatar());
QCOMPARE(url, QUrl(QStringLiteral("https://secure.gravatar.com:443/avatar/89b4e14cf2fc6d426275c019c6dc9de6?d=404&s=1024")));
job.setUseLibravatar(true);
@@ -169,9 +160,9 @@ void GravatarResolvUrlJobTest::shouldGenerateGravatarUrl_data()
QTest::newRow("empty") << QString() << QString() << QUrl() << false;
QTest::newRow("no domain") << QStringLiteral("foo") << QString() << QUrl() << false;
QTest::newRow("validemail") << QStringLiteral("[email protected]") << QStringLiteral("89b4e14cf2fc6d426275c019c6dc9de6")
- << QUrl(QStringLiteral("http://www.gravatar.com:80/avatar/89b4e14cf2fc6d426275c019c6dc9de6?d=404")) << false;
+ << QUrl(QStringLiteral("https://secure.gravatar.com:443/avatar/89b4e14cf2fc6d426275c019c6dc9de6?d=404")) << false;
QTest::newRow("validemaillibravatar") << QStringLiteral("[email protected]") << QStringLiteral("2726400c3a33ce56c0ff632cbc0474f766d3b36e68819c601fb02954c1681d85")
- << QUrl(QStringLiteral("http://cdn.libravatar.org:80/avatar/2726400c3a33ce56c0ff632cbc0474f766d3b36e68819c601fb02954c1681d85?d=404")) << true;
+ << QUrl(QStringLiteral("https://seccdn.libravatar.org:443/avatar/2726400c3a33ce56c0ff632cbc0474f766d3b36e68819c601fb02954c1681d85?d=404")) << true;
}
void GravatarResolvUrlJobTest::shouldGenerateGravatarUrl()
diff --git a/src/job/gravatarresolvurljob.cpp b/src/job/gravatarresolvurljob.cpp
index b366ae3..ac72767 100644
--- a/src/job/gravatarresolvurljob.cpp
+++ b/src/job/gravatarresolvurljob.cpp
@@ -42,7 +42,6 @@ public:
, mUseLibravatar(false)
, mFallbackGravatar(true)
, mFallbackDone(false)
- , mUseHttps(false)
{
}
@@ -57,7 +56,6 @@ public:
bool mUseLibravatar;
bool mFallbackGravatar;
bool mFallbackDone;
- bool mUseHttps;
};
GravatarResolvUrlJob::GravatarResolvUrlJob(QObject *parent)
@@ -169,16 +167,6 @@ QString GravatarResolvUrlJob::calculateHash(bool useLibravator)
return QString::fromUtf8(hash.result().toHex());
}
-bool GravatarResolvUrlJob::useHttps() const
-{
- return d->mUseHttps;
-}
-
-void GravatarResolvUrlJob::setUseHttps(bool useHttps)
-{
- d->mUseHttps = useHttps;
-}
-
bool GravatarResolvUrlJob::fallbackGravatar() const
{
return d->mFallbackGravatar;
@@ -259,13 +247,13 @@ QUrl GravatarResolvUrlJob::createUrl(bool useLibravatar)
if (d->mSize != 80) {
query.addQueryItem(QStringLiteral("s"), QString::number(d->mSize));
}
- url.setScheme(d->mUseHttps ? QStringLiteral("https") : QStringLiteral("http"));
+ url.setScheme(QStringLiteral("https"));
if (useLibravatar) {
- url.setHost(d->mUseHttps ? QStringLiteral("seccdn.libravatar.org") : QStringLiteral("cdn.libravatar.org"));
+ url.setHost(QStringLiteral("seccdn.libravatar.org"));
} else {
- url.setHost(d->mUseHttps ? QStringLiteral("secure.gravatar.com") : QStringLiteral("www.gravatar.com"));
+ url.setHost(QStringLiteral("secure.gravatar.com"));
}
- url.setPort(d->mUseHttps ? 443 : 80);
+ url.setPort(443);
d->mCalculatedHash = calculateHash(useLibravatar);
url.setPath(QLatin1String("/avatar/") + d->mCalculatedHash);
url.setQuery(query);
diff --git a/src/job/gravatarresolvurljob.h b/src/job/gravatarresolvurljob.h
index 955c873..b9b8841 100644
--- a/src/job/gravatarresolvurljob.h
+++ b/src/job/gravatarresolvurljob.h
@@ -64,9 +64,6 @@ public:
bool fallbackGravatar() const;
void setFallbackGravatar(bool fallbackGravatar);
- bool useHttps() const;
- void setUseHttps(bool useHttps);
-
Q_SIGNALS:
void finished(Gravatar::GravatarResolvUrlJob *);
void resolvUrl(const QUrl &url);
diff --git a/src/settings/gravatar.kcfg b/src/settings/gravatar.kcfg
index ef2546f..b006c37 100644
--- a/src/settings/gravatar.kcfg
+++ b/src/settings/gravatar.kcfg
@@ -18,10 +18,5 @@ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 http://www.kde.org/sta
<entry name="LibravatarSupportEnabled" type="Bool">
<default>false</default>
</entry>
- <entry name="GravatarHttpsSupport" type="Bool">
- <default>false</default>
- </entry>
-
</group>
</kcfg>
-
diff --git a/src/widgets/gravatarconfiguresettingsdialog.cpp b/src/widgets/gravatarconfiguresettingsdialog.cpp
index 5382a42..ff7fef0 100644
--- a/src/widgets/gravatarconfiguresettingsdialog.cpp
+++ b/src/widgets/gravatarconfiguresettingsdialog.cpp
@@ -112,7 +112,6 @@ void GravatarConfigureSettingsDialog::save()
saveSpinBox(mGravatarCacheSize, Gravatar::GravatarSettings::self()->gravatarCacheSizeItem());
saveCheckBox(mFallbackGravatar, Gravatar::GravatarSettings::self()->fallbackToGravatarItem());
saveCheckBox(mUseLibravatar, Gravatar::GravatarSettings::self()->libravatarSupportEnabledItem());
- //saveCheckBox(mUseHttps, Gravatar::GravatarSettings::self()->gravatarHttpsSupportItem());
accept();
}
@@ -122,7 +121,6 @@ void GravatarConfigureSettingsDialog::load()
loadWidget(mGravatarCacheSize, Gravatar::GravatarSettings::self()->gravatarCacheSizeItem());
loadWidget(mFallbackGravatar, Gravatar::GravatarSettings::self()->fallbackToGravatarItem());
loadWidget(mUseLibravatar, Gravatar::GravatarSettings::self()->libravatarSupportEnabledItem());
- //loadWidget(mUseHttps, Gravatar::GravatarSettings::self()->gravatarHttpsSupportItem());
}
void GravatarConfigureSettingsDialog::slotClearGravatarCache()
diff --git a/src/widgets/gravatarconfiguresettingsdialog.h b/src/widgets/gravatarconfiguresettingsdialog.h
index 10728b9..7d4e8f9 100644
--- a/src/widgets/gravatarconfiguresettingsdialog.h
+++ b/src/widgets/gravatarconfiguresettingsdialog.h
@@ -43,7 +43,6 @@ private:
QCheckBox *mUseDefaultPixmap;
QCheckBox *mUseLibravatar;
QCheckBox *mFallbackGravatar;
- //QCheckBox *mUseHttps;
QPushButton *mClearGravatarCache;
KPluralHandlingSpinBox *mGravatarCacheSize;
};
diff --git a/src/widgets/gravatardownloadpixmapwidget.cpp b/src/widgets/gravatardownloadpixmapwidget.cpp
index f8a32cd..2b1ecc8 100644
--- a/src/widgets/gravatardownloadpixmapwidget.cpp
+++ b/src/widgets/gravatardownloadpixmapwidget.cpp
@@ -42,10 +42,6 @@ GravatarDownloadPixmapWidget::GravatarDownloadPixmapWidget(QWidget *parent)
connect(mLineEdit, &QLineEdit::textChanged, this, &GravatarDownloadPixmapWidget::slotTextChanged);
hbox->addWidget(mLineEdit);
- mUseHttps = new QCheckBox(i18n("Use HTTPS Protocol"));
- mUseHttps->setObjectName(QStringLiteral("usehttps"));
- mainLayout->addWidget(mUseHttps);
-
mUseLibravatar = new QCheckBox(i18n("Use Libravatar"));
mUseLibravatar->setObjectName(QStringLiteral("uselibravatar"));
mainLayout->addWidget(mUseLibravatar);
@@ -100,7 +96,6 @@ void GravatarDownloadPixmapWidget::slotSearchButton()
//job->setUseDefaultPixmap(true);
job->setUseLibravatar(mUseLibravatar->isChecked());
job->setFallbackGravatar(mFallbackGravatar->isChecked());
- job->setUseHttps(mUseHttps->isChecked());
//qDebug() << job->generateGravatarUrl(false);
if (job->canStart()) {
connect(job, &GravatarResolvUrlJob::finished, this, &GravatarDownloadPixmapWidget::slotResolvUrlFinish);
diff --git a/src/widgets/gravatardownloadpixmapwidget.h b/src/widgets/gravatardownloadpixmapwidget.h
index f844c68..7ae909e 100644
--- a/src/widgets/gravatardownloadpixmapwidget.h
+++ b/src/widgets/gravatardownloadpixmapwidget.h
@@ -49,7 +49,6 @@ private:
QPushButton *mGetPixmapButton;
QCheckBox *mUseLibravatar;
QCheckBox *mFallbackGravatar;
- QCheckBox *mUseHttps;
};
}