-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unlocking database with Onlykey is a hit and miss #4400
Comments
This could be an onlykey firmware issue. We block the unlock process until the hardware key returns the response. There is no way we would continue unless we heard back from the key. |
Also a possibility I will also notify the Onlykev Dev's. Is there some debug I can enable in order to see what is being received by KeepassXC? I could try to sniff the USB-bus but that probably won't be as easy:) |
No you'd have to debug KeePassXC itself. It would be unintelligible to a human anyway |
@Jeroen2000 This may happen if you created a keepass database using slot 1 on OnlyKey (or Yubikey) and then you select slot 2 when trying to open the database created with slot 1 (or vice versa). Can you verify that you see the issue when you know for sure that the right slot is selected? |
@onlykey 100% positive I have the right slot. KeepassXC defaults to slot 1 so I need not select anything. I was adding some entries to my Keepass just now and when I save, I have to hit a button on the Onlykey and I had 2 failures out of 5 saves |
@Jeroen2000 Is there any other details you could provide that would help reproduce? Have you tried on Mac at all and had similar issues? Created an issue here to track in OnlyKey repo - trustcrypto/OnlyKey-Firmware#107 |
@onlykey do we need to take this discussion to the link you posted? I have tested on 2 Windows 10 devices so far (a laptop and a desktop)
For the database opening errors, I have had to try many times (4 or 5) on one occasion. Unplugging Onlykey, closing and opening KeepassXC. Each time I verified my password attentively. I happen to have a Macbook so I'll try to find out whether there is similar behaviour or not. |
@onlykey I have now started testing on the Macbook. When trying to open my DB just now, KeepassXC would not recognise Onlykey. I hit refresh multiple times, closed and opened KeepassXC and unplugged and replugged Onlykey. I gave up after 5 tries and rebooted. This morning it worked fine though. I was able to update 5 entries with only one failure on the first try. It happens enough to reproduce but I am unable to pinpoint what makes it go into limbo. |
I am going to work on hardware key robustness next for 2.6.0 so this will be a good test of my changes. |
@Jeroen2000 For mac if you have Catalina there are extra steps to install KeepassXC and use with OnlyKey/Yubikey mentioned here - https://docs.crp.to/usersguide.html#keepassxc I have not seen or have been able to reproduce issues like the ones you are finding here. Do you have something else you could test to help verify, a Yubikey or another OnlyKey? Some possible issues would be a bad USB extension (try directly plugging in device) or a damaged Onlykey. |
@droidmonkey you may always contact me for testing. More than happy to help. |
Got a new 'type' of error. Normally, when KeepassXC asks you to 'touch a button' on the Onlykey, it should start flashing yellow. As you can see in the video, nothing happens and KeepassXC errors out (almost) immediately. I had to unplug and replug to get out of this state. See video |
Thank you for the video! I still think this is a firmware issue. |
Seems like there is something wrong with the keepassxc implementation for OnlyKey with challenge response on Linux too. My setup: Below are some screenshots and test cases: So this does not seem to be OS specific. Perhaps it is a combination of both: firmware and keepassxc so changes on both may be required. I have provided some more feedback on the firmware issue when manipulating OnlyKey via keepassxc here: HTH, |
The code on KeePassXC side between onlykey and yubikey is exactly the same. The duplicate slots in the master key dialog was fixed (I thought so)?? It has nothing to do with this problem. |
Hi @droidmonkey As for the random failure to detect OnlyKey for challenge response, this could be something that is either with keepassxc detection causing the firmware to fail or just a bug in the firmware alone. I do not know and I do not have an easy way to figure out. Let me know if I can do anything else to help. The fact is, this is happening on all 3 OSes: GNU/Linux, Mac OS and Windoze running latest stable keepassxc and latest OnlyKey firmware. |
I am currently working on this problem. I hope to have a fix by tonight |
@droidmonkey I can also test since when you have it ready. I can also confirm the issue is present on MacOS (I am running High Sierra) and I have tested with a 2nd key just to rule out whether my key was a lemon. It feels actually worse than on Windows as on MacOs there is the additional issue of getting the key recognised in the first place. On Windows it is "just" the unlocking that goes wrong when the led is already flashing yellow. |
I've gotten it to the point where onlykey is extremely reliable and can work concurrently with another connected yubikey! |
@droidmonkey That's great news! Let me know if you want me to test out any changes I will be happy to do that. |
Sure will, I'll notify here when I post the PR for my changes. They are quite substantive. |
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087
@onlykey Please see the PR I just posted with the major refactor to hardware key support |
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
Nice work on this! Thank you. This works much better now, so it is usable I would say. On a quick glance, I noticed some issues: 1.) If you have more than one database files opened, one configured with challenge-response but the others not, once you work with the one for challenge response, if you go back to a file that does not make use of challenge response, it still enumerates the slots... should it 'remember' and only issue a 'refresh' on database files that were used with challenge response? 2.) at least with OnlyKey, refreshing the slots makes the HID Keyboard disappear, so I still need the workaround with udev to reattach it. Here, there is no change of behaviour with the previous version. 3.) There is no prompt anywhere in the UI to 'remind' the user that a button has to be pressed for challenge-response to work (not a big deal). Cheers, |
|
I can test too for several weeks to see how it behaves:-) @nkichukov what did you do exactly to get this running? I am on MacOS. |
@droidmonkey
and then follow the steps to compile and install it from the source in 'testme'. |
Ahhh the press to type... That works for yubikey with my changes, I explicitly tested that case. There is really no reason why it wouldn't work for only key. The only time the key is "held" by kpxc is when it is being polled on refresh and when a challenge is occurring. |
confirmed, it also works fine with OnlyKey now. |
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
@droidmonkey I ran this through some tests today, so far so good, great job! I will keep testing and let you know if I run into any issues. |
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
* Significantly improve user experience when using hardware keys on databases in both GUI and CLI modes. Prevent locking up the YubiKey USB interface for prolonged periods of time. Allows for other apps to use the key concurrently with KeePassXC. * Improve messages displayed to user when finding keys and when user interaction is required. Output specific error messages when handling hardware keys during database read/write. * Only poll for keys when previously used or upon user request. Prevent continuously polling keys when accessing the UI such as switching tabs and minimize/maximize. * Add support for using multiple hardware keys simultaneously. Keys are identified by their serial number which prevents using the wrong key during open and save operations. * Fixes #4400 * Fixes #4065 * Fixes #1050 * Fixes #1215 * Fixes #3087 * Fixes #1088 * Fixes #1869
Expected Behavior
When KeepassXC says "Please touch the button on your YubiKey!" I expect the database to open if I touch a button on the Onlykey and have typed the correct password.
Current Behavior
I sometimes get this error: "Error while reading the database: Unable to calculate master key". I have verified thoroughly that I got my password typed right. There seems to be some timing issue: press too fast and it won't work, press too late and it won't work either.
Steps to Reproduce
Debug Info
KeePassXC - Version 2.5.3
Revision: f8c962b
Qt 5.13.2
Debugging mode is disabled.
Operating system: Windows 10 (10.0)
CPU architecture: x86_64
Kernel: winnt 10.0.18363
Enabled extensions:
Cryptographic libraries:
libgcrypt 1.8.5
The text was updated successfully, but these errors were encountered: