Bug 387532 - Conflicting device IDs cause paired devices to become unpaired
Summary: Conflicting device IDs cause paired devices to become unpaired
Status: RESOLVED FIXED
Alias: None
Product: kdeconnect
Classification: Applications
Component: common (other bugs)
Version First Reported In: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Albert Vaca Cintora
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-02 18:34 UTC by Yuxuan Shui
Modified: 2023-04-01 09:27 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuxuan Shui 2017-12-02 18:34:37 UTC
Step to reproduce:

1. pair PC with android device
2. run kdeconnect -l several times
3. the android apps would say "Device not paired"

kdeconnect -l also cause connected device to disconnect, not sure if it's the same problem.
Comment 1 Yuxuan Shui 2017-12-02 19:00:51 UTC
Possibly related lines in log:

kdeconnect.core: Starting client ssl (but I'm the server TCP socket)
kdeconnect.core: Failing due to  ("The host name did not match any of the valid hosts for this certificate")
Comment 2 Yuxuan Shui 2017-12-02 19:08:49 UTC
Seems like, the CN= field in the certificate is different from the device ID.

Actually, that CN is the same as the device ID my phone used to have (I wiped my phone and the ID changed).
Comment 3 Yuxuan Shui 2017-12-02 19:13:44 UTC
This problem persists after I remove ~/.config/kdeconnect
Comment 4 Yuxuan Shui 2017-12-02 19:17:50 UTC
This problem goes away after clear data on the Android side.

So probably the Android app is sending conflicting device IDs?

Maybe kdeconnect should reject pair requests like this?
Comment 5 Yuxuan Shui 2017-12-02 19:35:48 UTC
I guess two changes are needed:

1. verify the CN in certificate sent by the device
2. on android, detect device id changes (happens after user wipe the device and restore apps from backup)
Comment 6 Albert Vaca Cintora 2023-04-01 09:27:45 UTC
Fixed in https://invent.kde.org/network/kdeconnect-android/-/merge_requests/326