2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-31 14:15:14 +00:00

Enforce the protocol doesn't change after the handshake

This commit is contained in:
Albert Vaca Cintora
2025-02-01 11:20:49 +01:00
parent f8a2d2da03
commit fe97750e9a

View File

@@ -248,6 +248,10 @@ public class LanLinkProvider extends BaseLinkProvider {
if (!DeviceInfo.isValidIdentityPacket(secureIdentityPacket)) {
throw new JSONException("Invalid identity packet");
}
if (secureIdentityPacket.getInt("protocolVersion") != protocolVersion) {
Log.e("KDE/LanLinkProvider", "Protocol version changed half-way through the handshake");
return;
}
} else {
secureIdentityPacket = identityPacket;
}