-
Notifications
You must be signed in to change notification settings - Fork 58
Labels
awaiting yubico actionWhen we've got the ballWhen we've got the ballbugSomething isn't workingSomething isn't working
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
If you plug / unplug a Yubikey a lot (and YubiKeyDeviceListener
has been instantiated), it's possible to occasionally hit a KeyNotFoundException
in CmDevice
.
This exception is thrown on a background thread, meaning that it crashes the user's application, and there is no way for the user to prevent this.
The stack trace is:
Yubico.Core.dll!Yubico.PlatformInterop.CmDevice.GetProperty<string>(Yubico.PlatformInterop.CmDeviceProperty property) Line 112
Yubico.Core.dll!Yubico.PlatformInterop.CmDevice.CmDevice(string devicePath) Line 41
Yubico.Core.dll!Yubico.Core.Devices.Hid.WindowsHidDeviceListener.OnEventReceived(nint hNotify, nint context, Yubico.PlatformInterop.NativeMethods.CM_NOTIFY_ACTION action, nint eventDataPtr, int eventDataSize) Line 97
The line in question is this one, called with CmDeviceProperty.PdoName
from here.
Expected Behavior
The expected behaviour is that Yubikey does not crash the user's application in an unrecoverable way.
Steps To Reproduce
- In a Windows project, subscribe to
YubiKeyDeviceListener.Instance.Arrived
. I don't think the subscription is actually necessary (just accessingYubiKeyDeviceListener.Instance
might be enough), since theYuibKeyDeviceListener
ctor callsHidDeviceListener.Create()
, which is what instantiatesWindowsHidDeviceListener
, which is what has the unsafe event handler. - Plug and unplug the Yubikey a lot (might take a number of minutes). Vary the amount of time that the Yubikey is plugged in for, but no need to have it plugged in for more than 2s. Having Yubico Authenticator open at the same time might help reproduce, but I have seen it with nothing else open
- Watch your application crash with the above exception
I have seen this pop up two or three times in normal usage.
Version
1.9.0
Version
5.4.3
Anything else?
No response
Metadata
Metadata
Assignees
Labels
awaiting yubico actionWhen we've got the ballWhen we've got the ballbugSomething isn't workingSomething isn't working