-
-
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
Yubikey is not re-detected after replugging. #712
Comments
I suppose this is rather a YubiKey lib issue. |
Not sure - but I've found out that it locks you out of slot 1 operation while you use it for Keepassxc - which makes me think that the key isn't closed between required uses... EDIT: I should clarify that my Challenge/Response config is in slot 2. |
I believe that this is Keepassxc issue. I have found a workaround - you can redetect yubikey without quitting keepassxc. You need to go to Databases -> Change master key -> Click refresh under Challenge response section. Keepassxc will be able to use your yubikey. I would suppose to call Challenge/Response refresh procedure before saving the database if the database is opened via yubikey and there is no yubikey present. |
These bits of code interest me - but I'm absolutely hopeless at C++..... keepassxc/src/gui/DatabaseOpenWidget.cpp Line 65 in 139658b
One is for the Open Database dialog, the other for modifying the master key. They seem to be somewhat different - but my C++ skills are that useless that I can't track things further to figure out what's going on here - but it seems like a prime candidate. |
The loop inside I wrote a simple patch to fix this, but there still is a problem that KeePassXC doesn't display a message asking to press a button on the key in case of an error. I suspect it's caused by how fast a sequence of |
Instead of retrying a predefined number of times in case of an error, always try to re-init Yubikey before issuing a challenge. Fixes keepassxreboot#712.
So I thought about this issue a bit more, and now I think using retries is not a proper way to address this: it's just too general to make this one additional challenge attempt. Here's a patch that replaces the retry loop with a call to
One problem this could cause would be a possible performance hit for calling What do you think? Edit: Forgot to remove |
Instead of retrying a predefined number of times in case of an error, always try to re-init Yubikey before issuing a challenge. Fixes keepassxreboot#712.
Not specifically related to the patch - but regarding the dual slot functionality. Right now, I have OTP mode in slot 1, and non-button press Challenge/Response in slot 2. When the C/R happens, and after you have unlocked your KP database, I find that the slot 1 function no longer works until I replug the Yubikey. I would expect that proper behaviour would be to release the Yubikey until it is needed again - which in theory would allow functionality in the other slot to work again. Is this your understanding? or is there something else I'm not taking into account here? |
@CRCinAU Edit: Oh, I think the issue #698 is the same, but in that case they're unable to use static password instead of OTP. |
This is particularly nasty because if you try to save the database with the yubikey in a "disconnected" state you can corrupt the database file. I just did this playing around with a test database (thankfully). This bug needs to be fixed ASAP. |
Is there any progress on this? I was the one who filed #864 and as @droidmonkey described, I corrupted my database. Thankfully, I have revision history for the database file. This needs to be fixed urgently. |
Another consequence of this issue is that keepassxc will only recognize a yubikey if it is plugged in before keepassxc is launched. So if you are working with a database and then attempt to open another one that requires the yubikey, you must quit and relaunch keepassxc. |
You can click the Refresh button to detect a key that was inserted after KeePassXC has been started. |
I'll be working on this tomorrow. |
@droidmonkey Out of interest, does this fix releasing the Yubikey after a C/R cycle? I use an OTP in slot 1, C/R in slot 2. Once I use the C/R within KeepassXC, I cannot use the OTP function without re-plugging in the Yubikey... |
It might not, i didnt see any obvious hold on the yubikey except when performing the c/r. I am able to use a static password on slot 2 and c/r in slot 1 without issue. |
If you use just the C/R in slot 2 for KeepassXC, with Slot 1 configured for an OTP, can you generate an OTP into a text editor afterwards? My OTP is used purely for an OpenVPN connection... |
I'll try that |
I configured the Yubikey per your method and it works great (even with the origin 2.2.0 release). I even required a press to issue the c/r. This might be an issue on your end that is unrelated to KeePassXC. I did notice some flakiness when the Yubikey Personalization Tool was open, it seemed to be disconnecting and reconnecting the yubikey several times. |
Interesting... Which version key was this? Did it do the same if you didn't require a press for the C/R? Mine is the original Yubikey - and the light comes back on after the C/R - but when I press it to do the OTP, the light goes out and never returns... ie my sequence:
|
I have the Neo, just recently purchased for testing purposes. I am also on Windows 10 so that may be a difference. I will have to try this in Linux to see if the behavior replicates. |
Oh yeah, Windows.... I forgot that was a thing :\ |
@droidmonkey I am experiencing this issue under Linux (Fedora 26, 4.12.5-300.fc26.x86_64). My report #864 has some more debug info, if that's useful at all... |
Notes on closure? |
Fixed in #880 |
When using the Challenge/Response mode with a Yubikey, if you unplug the key and replug it, the key is no longer detected or able to do the challenge / response authentication.
This leads to being unable to save the database after any changes.
Error message states:
Writing the database failed. Unable to issue challenge-response.
Expected Behavior
Key should be redetected on replug - or only accessed when the functionality is needed.
Current Behavior
Possible Solution
Should only access the Yubikey when a challenge is required. Once the challenge is complete, the key should be released.
Debug Info
KeePassXC - Version 2.2.0
Revision: caa49a8
Libraries:
Operating system: Fedora 26 (Twenty Six)
CPU architecture: x86_64
Kernel: linux 4.11.6-301.fc26.x86_64
Enabled extensions:
The text was updated successfully, but these errors were encountered: