From: Manuel Nickschas Date: Tue, 13 Sep 2016 22:46:07 +0000 (+0200) Subject: Remove CoreInfo from the ClientRegistered handshake message X-Git-Tag: travis-deploy-test~387 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=3856cfd6126cdea97c91a22be7ded92ccc0a3577 Remove CoreInfo from the ClientRegistered handshake message 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. --- diff --git a/src/common/protocol.h b/src/common/protocol.h index 9af3b249..c7cbcb3a 100644 --- a/src/common/protocol.h +++ b/src/common/protocol.h @@ -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; }; diff --git a/src/common/protocols/datastream/datastreampeer.cpp b/src/common/protocols/datastream/datastreampeer.cpp index b7b9b36f..af2fcb4f 100644 --- a/src/common/protocols/datastream/datastreampeer.cpp +++ b/src/common/protocols/datastream/datastreampeer.cpp @@ -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") { diff --git a/src/common/protocols/legacy/legacypeer.cpp b/src/common/protocols/legacy/legacypeer.cpp index f1470ff9..9ceb4607 100644 --- a/src/common/protocols/legacy/legacypeer.cpp +++ b/src/common/protocols/legacy/legacypeer.cpp @@ -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; diff --git a/src/core/coreauthhandler.cpp b/src/core/coreauthhandler.cpp index e2b35219..90f4ad84 100644 --- a/src/core/coreauthhandler.cpp +++ b/src/core/coreauthhandler.cpp @@ -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("Quassel Core Version %1
" - "Version date: %2
" - "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();