solokeys / solo1-cli

Solo 1 library and CLI in Python
https://pypi.org/project/solo-python
Apache License 2.0
183 stars 69 forks source link

Wait that udev has set owner and group #116

Closed pilou- closed 3 years ago

pilou- commented 3 years ago

Udev rules take some time to be applied, then fido2 lib fails to open the solokey since the group of the device hasn't been set:

$ solo key update
Wrote temporary copy of firmware-4.1.1.json to /tmp/tmpa67i8qxc.json
sha256sums coincide: 45e7071107fa5acb494e4c5d4831344dd531b1a537a230a6157f4f71dba87e2c
Switching into bootloader mode...
error:
problem flashing firmware!
no Solo found

With this patch, the key is found after switching into bootloader mode but the key doesn't switch to bootloader mode, which is another issue. At least the messages are improved:

$ solo key update
Wrote temporary copy of firmware-4.1.1.json to /tmp/tmpvwzbaat0.json
sha256sums coincide: 45e7071107fa5acb494e4c5d4831344dd531b1a537a230a6157f4f71dba87e2c
Switching into bootloader mode...
Wait for device '205C36995548'...
using signature version <=2.5.3
erasing firmware...
Could not switch into bootloader mode.
Please put key into bootloader mode:
1. Unplug key
2. While holding button, plug in key for 2s

Could be related to #113.

pilou- commented 3 years ago

Updated: use black and flake8

conorpp commented 3 years ago

Since we don't reliably have access to serial_number yet because of fido2 0.9.1, I'm going to close this. Thank you for the PR though, we can have a reference later on. I've increased the delay from .5 to 1.5.