Check that the device ID doesn't change during the handshake

This commit is contained in:
Albert Vaca Cintora
2025-11-16 17:43:48 +01:00
parent 8e2804a8bb
commit 675d2d24a1

View File

@@ -309,7 +309,13 @@ public class LanLinkProvider extends BaseLinkProvider {
}
int newProtocolVersion = secureIdentityPacket.getInt("protocolVersion");
if (newProtocolVersion != protocolVersion) {
Log.w("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake: " + protocolVersion + " ->" + newProtocolVersion);
Log.e("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake: " + protocolVersion + " ->" + newProtocolVersion);
return;
}
String newDeviceId = secureIdentityPacket.getString("deviceId");
if (!newDeviceId.equals(deviceId)) {
Log.e("KDE/LanLinkProvider", "Device ID changed half-way through the handshake: " + protocolVersion + " ->" + newProtocolVersion);
return;
}
} else {
secureIdentityPacket = identityPacket;