Remove CoreInfo from the ClientRegistered handshake message
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 13 Sep 2016 22:46:07 +0000 (00:46 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 4 Apr 2018 21:14:03 +0000 (23:14 +0200)
This string was only used by pre-0.5 clients, and even then only
for displaying information on the connection dialog during the
handshake phase, so it is safe to remove. This prevents the core
from leaking information about itself before a successful login.

(cherry picked from commit 3856cfd6126cdea97c91a22be7ded92ccc0a3577)

src/common/protocol.h
src/common/protocols/datastream/datastreampeer.cpp
src/common/protocols/legacy/legacypeer.cpp
src/core/coreauthhandler.cpp

index ba70530..4bff50a 100644 (file)
@@ -81,12 +81,11 @@ struct ClientDenied : public HandshakeMessage
 
 struct ClientRegistered : public HandshakeMessage
 {
-    inline ClientRegistered(quint32 coreFeatures, bool coreConfigured, const QVariantList &backendInfo, bool sslSupported, const QString &coreInfo)
+    inline ClientRegistered(quint32 coreFeatures, bool coreConfigured, const QVariantList &backendInfo, bool sslSupported)
     : coreFeatures(coreFeatures)
     , coreConfigured(coreConfigured)
     , backendInfo(backendInfo)
     , sslSupported(sslSupported)
-    , coreInfo(coreInfo)
     {}
 
     quint32 coreFeatures;
@@ -95,7 +94,6 @@ struct ClientRegistered : public HandshakeMessage
 
     // this is only used by the LegacyProtocol in compat mode
     bool sslSupported;
-    QString coreInfo;
 };
 
 
index d3bd110..763679f 100644 (file)
@@ -124,7 +124,7 @@ void DataStreamPeer::handleHandshakeMessage(const QVariantList &mapData)
     }
 
     else if (msgType == "ClientInitAck") {
-        handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), false, QString())); // SupportsSsl and coreInfo obsolete
+        handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), false)); // SupportsSsl is obsolete
     }
 
     else if (msgType == "CoreSetupData") {
index 6c4a716..5283ecd 100644 (file)
@@ -170,7 +170,7 @@ void LegacyPeer::handleHandshakeMessage(const QVariant &msg)
             socket()->setProperty("UseCompression", true);
 #endif
 
-        handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), m["SupportSsl"].toBool(), QString()));
+        handle(ClientRegistered(m["CoreFeatures"].toUInt(), m["Configured"].toBool(), m["StorageBackends"].toList(), m["SupportSsl"].toBool()));
     }
 
     else if (msgType == "CoreSetupData") {
@@ -248,8 +248,8 @@ void LegacyPeer::dispatch(const ClientRegistered &msg) {
     m["SupportSsl"] = msg.sslSupported;
     m["SupportsCompression"] = socket()->property("UseCompression").toBool(); // this property gets already set in the ClientInit handler
 
-    // This is only used for old v10 clients (pre-0.5)
-    m["CoreInfo"] = msg.coreInfo;
+    // This is only used for display by really old v10 clients (pre-0.5), and we no longer set this
+    m["CoreInfo"] = QString();
 
     m["LoginEnabled"] = m["Configured"] = msg.coreConfigured;
 
index d499301..a66a8e9 100644 (file)
@@ -176,18 +176,8 @@ void CoreAuthHandler::handle(const RegisterClient &msg)
     if (!configured)
         backends = Core::backendInfo();
 
-    int uptime = Core::instance()->startTime().secsTo(QDateTime::currentDateTime().toUTC());
-    int updays = uptime / 86400; uptime %= 86400;
-    int uphours = uptime / 3600; uptime %= 3600;
-    int upmins = uptime / 60;
-    QString coreInfo = tr("<b>Quassel Core Version %1</b><br>"
-                          "Version date: %2<br>"
-                          "Up %3d%4h%5m (since %6)").arg(Quassel::buildInfo().fancyVersionString)
-                          .arg(Quassel::buildInfo().commitDate)
-                          .arg(updays).arg(uphours, 2, 10, QChar('0')).arg(upmins, 2, 10, QChar('0')).arg(Core::instance()->startTime().toString(Qt::TextDate));
-
-    // useSsl and coreInfo are only used for the legacy protocol
-    _peer->dispatch(ClientRegistered(Quassel::features(), configured, backends, useSsl, coreInfo));
+    // useSsl is only used for the legacy protocol
+    _peer->dispatch(ClientRegistered(Quassel::features(), configured, backends, useSsl));
 
     if (_legacy && useSsl)
         startSsl();