Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Nov 2025 17:06:37 GMT
From:      Max Brazhnikov <makc@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: d49ea24d98b0 - main - deskutils/kdeconnect-kde: backport upstream patch:
Message-ID:  <202511171706.5AHH6bxH064379@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by makc:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d49ea24d98b0a267090aa96d45de0b59799120c2

commit d49ea24d98b0a267090aa96d45de0b59799120c2
Author:     Max Brazhnikov <makc@FreeBSD.org>
AuthorDate: 2025-11-17 16:58:31 +0000
Commit:     Max Brazhnikov <makc@FreeBSD.org>
CommitDate: 2025-11-17 17:02:52 +0000

    deskutils/kdeconnect-kde: backport upstream patch:
    
    Check that the device ID doesn't change during the handshake.
---
 deskutils/kdeconnect-kde/Makefile                  |  1 +
 .../patch-core_backends_lan_lanlinkprovider.cpp    | 45 ++++++++++++++--------
 2 files changed, 30 insertions(+), 16 deletions(-)

diff --git a/deskutils/kdeconnect-kde/Makefile b/deskutils/kdeconnect-kde/Makefile
index d3083ca92e82..748e8a9e4720 100644
--- a/deskutils/kdeconnect-kde/Makefile
+++ b/deskutils/kdeconnect-kde/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	kdeconnect-kde
 DISTVERSION=	${KDE_APPLICATIONS_VERSION}
+PORTREVISION=	1
 CATEGORIES=	deskutils kde kde-applications
 
 MAINTAINER=	kde@FreeBSD.org
diff --git a/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp b/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp
index 47e10fb8326f..9fb5f425bff6 100644
--- a/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp
+++ b/deskutils/kdeconnect-kde/files/patch-core_backends_lan_lanlinkprovider.cpp
@@ -1,19 +1,32 @@
---- core/backends/lan/lanlinkprovider.cpp.orig	2023-12-18 22:14:59 UTC
+--- core/backends/lan/lanlinkprovider.cpp.orig	2025-11-01 18:19:03 UTC
 +++ core/backends/lan/lanlinkprovider.cpp
-@@ -291,6 +291,16 @@ void LanLinkProvider::udpBroadcastReceived()
-         m_lastConnectionTime[deviceId] = now;
+@@ -427,6 +427,7 @@ void LanLinkProvider::encrypted()
  
-         int tcpPort = receivedPacket->get<int>(QStringLiteral("tcpPort"));
-+        // convert IPv6 addresses of type "v4-mapped" to IPv4
-+        QHostAddress addr = sender;
-+        if (addr.protocol() == QAbstractSocket::IPv6Protocol) {
-+            bool success;
-+            QHostAddress convertedAddr = QHostAddress(addr.toIPv4Address(&success));
-+            if (success) {
-+                // qCDebug(KDECONNECT_CORE) << "Converting IPv6" << addr << "to IPv4" << convertedAddr;
-+                sender = convertedAddr;
+     NetworkPacket *identityPacket = m_receivedIdentityPackets[socket].np;
+ 
++    QString deviceId = identityPacket->get<QString>(QStringLiteral("deviceId"));
+     int protocolVersion = identityPacket->get<int>(QStringLiteral("protocolVersion"), -1);
+     if (protocolVersion >= 8) {
+         disconnect(socket, &QObject::destroyed, nullptr, nullptr);
+@@ -435,7 +436,7 @@ void LanLinkProvider::encrypted()
+         NetworkPacket myIdentity = KdeConnectConfig::instance().deviceInfo().toIdentityPacket();
+         socket->write(myIdentity.serialize());
+         socket->flush();
+-        connect(socket, &QIODevice::readyRead, this, [this, socket, protocolVersion]() {
++        connect(socket, &QIODevice::readyRead, this, [this, socket, protocolVersion, deviceId]() {
+             if (!socket->canReadLine()) {
+                 // This can happen if the packet is large enough to be split in two chunks
+                 return;
+@@ -452,6 +453,12 @@ void LanLinkProvider::encrypted()
+             int newProtocolVersion = secureIdentityPacket->get<int>(QStringLiteral("protocolVersion"), 0);
+             if (newProtocolVersion != protocolVersion) {
+                 qCWarning(KDECONNECT_CORE) << "Protocol version changed half-way through the handshake:" << protocolVersion << "->" << newProtocolVersion;
++                return;
 +            }
-+        }
-         if (tcpPort < MIN_TCP_PORT || tcpPort > MAX_TCP_PORT) {
-             qCDebug(KDECONNECT_CORE) << "TCP port outside of kdeconnect's range";
-             delete receivedPacket;
++            QString newDeviceId = secureIdentityPacket->get<QString>(QStringLiteral("deviceId"));
++            if (newDeviceId != deviceId) {
++                qCWarning(KDECONNECT_CORE) << "Device ID changed half-way through the handshake:" << deviceId << "->" << newDeviceId;
++                return;
+             }
+             DeviceInfo deviceInfo = DeviceInfo::FromIdentityPacketAndCert(*secureIdentityPacket, socket->peerCertificate());
+ 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202511171706.5AHH6bxH064379>