2
0
mirror of https://github.com/KDE/kdeconnect-android synced 2025-08-22 09:58:08 +00:00
This commit is contained in:
Albert Vaca Cintora 2025-03-03 14:41:30 +01:00
parent 08fcfc863a
commit 34c2c311e2
No known key found for this signature in database

View File

@ -249,8 +249,12 @@ public class LanLinkProvider extends BaseLinkProvider {
writer.write(myIdentity.serialize().getBytes(Charsets.UTF_8));
writer.flush();
BufferedReader reader = new BufferedReader(new InputStreamReader(sslSocket.getInputStream()));
String line = reader.readLine();
if (line == null) {
throw new JSONException("Can't read line");
}
// Do not trust the identity packet we received unencrypted
secureIdentityPacket = NetworkPacket.unserialize(reader.readLine());
secureIdentityPacket = NetworkPacket.unserialize(line);
if (!DeviceInfo.isValidIdentityPacket(secureIdentityPacket)) {
throw new JSONException("Invalid identity packet");
}