mirror of
https://invent.kde.org/network/kdeconnect-android.git
synced 2025-12-12 20:35:58 +01:00
Check that the device ID doesn't change during the handshake
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user