synckeys icon indicating copy to clipboard operation
synckeys copied to clipboard

Does not work with current BLE stack

Open kshots opened this issue 5 months ago • 2 comments

I get the following when attempting to run the script as described (after copying the structure due to MAC change as suggested):

succubus /home/rich/git/synckeys # ./synckeys.py /mnt/windows/keydump.reg 
Bluetooth Adapter - 14:AC:60:69:05:F2
  CE:NT:RA:LI:RK (# not paired #)

  10:7C:61:00:7C:F9 (ROG CETRA TWS SN / ROG CETRA TWS SN)
    | LinkKey: 5DF55300BCD65C30CF62263FCF969984 > No change required.

  FA:C0:FC:C3:57:4B (MX Anywhere 3 / MX Anywhere 3)
    | IdentityResolvingKey: AB7F0C7BA187F99C4A8A047B8A313CEC > Update to: F4C2F5C524737664143FBDA982E6DC94
Traceback (most recent call last):
  File "/home/rich/git/synckeys/./synckeys.py", line 240, in <module>
    main()
  File "/home/rich/git/synckeys/./synckeys.py", line 236, in main
    process_devices(config)
  File "/home/rich/git/synckeys/./synckeys.py", line 224, in process_devices
    process_advanced_pairing(config[device], adapter_mac, device_mac)
  File "/home/rich/git/synckeys/./synckeys.py", line 163, in process_advanced_pairing
    current_ltk = paired_config['LongTermKey']['Key']
                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/configparser.py", line 941, in __getitem__
    raise KeyError(key)
KeyError: 'LongTermKey'

I suspect the problem is centered around the current structure, which includes a "PeripheralLongTermKey" and a "SlaveLongTermKey", but not a simple "LongTermKey" entry.

For reference, attached is a text export of the windows side of the registry entry. I'm not concerned about exposing the key here - I'll simply re-pair it when I have a successful mechanism to do so...

bluetooth key (mouse).txt

kshots avatar Jul 21 '25 14:07 kshots

For completeness, I should also include the linux-side entry as below:

[General]
Name=MX Anywhere 3
Appearance=0x03c2
AddressType=static
SupportedTechnologies=LE;
Trusted=true
Blocked=false
CablePairing=false
WakeAllowed=true
Services=00001800-0000-1000-8000-00805f9b34fb;00001801-0000-1000-8000-00805f9b34fb;0000180a-0000-1000-8000-00805f9b34fb;0000180f-0000-1000-8000-00805f9b34fb;00001812-0000-1000-8000-00805f9b34fb;00010000-0000-1000-8000-011f2000046d;

[IdentityResolvingKey]
Key=AB7F0C7BA187F99C4A8A047B8A313CEC

[PeripheralLongTermKey]
Key=799AF925A00957095940AB2B597D67C1
Authenticated=2
EncSize=16
EDiv=0
Rand=0

[SlaveLongTermKey]
Key=799AF925A00957095940AB2B597D67C1
Authenticated=2
EncSize=16
EDiv=0
Rand=0

[ConnectionParameters]
MinInterval=6
MaxInterval=9
Latency=44
Timeout=216

[DeviceID]
Source=2
Vendor=1133
Product=45093
Version=21

kshots avatar Jul 21 '25 14:07 kshots

I'll try to debug it this week

ademlabs avatar Aug 12 '25 08:08 ademlabs