Closed DSBloom closed 1 month ago
There's an ongoing discussion to improve the disposing of the Yubikey connection and the thread that manages it. To me it's odd that it has only started happening to you recently. Perhaps @GregDomzalski @jamiehankins might have some additional insight.
Yeah - I had, perhaps rather short-sightedly, switched our handle opening for smart cards to be exclusive. This was to combat the Windows smart card stack (i.e. minidrivers) from coming and yanking the connection out from under us. This behavior was introduced in 1.9.1. Downgrading to 1.9.0 would resolve this issue for you. Unfortunately 1.10.0 just shipped with this same behavior in tact. We should probably consider reverting that one change or putting it behind an AppContext switch to toggle the behavior and releasing a 1.10.1 so folks can continue to track the latest release.
But in reality, a better, longer term fix is probably for us to always select the smart card app at the beginning of each transaction. That would prevent the previously observed behavior of "invalid command" being thrown later on after Windows has essentially switched the YubiKey to PIV away from whatever you were doing at that moment. I still haven't thought through all of the implications of doing that w.r.t. any state being tracked by the YubiKey. And still, the issue that remains that we don't really have a great way to block PIV activation if you are using a different USB interface like FIDO or OTP...
Hello,
I've recently started having this error when trying to do any Yubikey operations. I see this error in the internal Yubico logging. This is a WPF app written in Dotnet 6, I am using version 1.9.1 of the SDK.
How can I find out what else us using the Yubikey? I've rebooted my machine and it didn't fix it. I don't understand why this error started popping up when my app has been working for years.