Yubico / Yubico.NET.SDK

A YubiKey SDK for .NET developers
Apache License 2.0
96 stars 48 forks source link

Exception thrown with Oath example #1

Closed buchwasa closed 2 years ago

buchwasa commented 2 years ago

Using the SDK example on .NET 3.1, I am able to list my YubiKey and select it, however, when I go to use anything regarding credentials, I get an exception of "This comand failed to complete" Line where the error occurs.

GregDomzalski commented 2 years ago

Thank you for reporting this issue!

Would you be able to share additional information about the exception; specifically the call stack?

Would you please provide your OS and YubiKey version as well?

buchwasa commented 2 years ago

Sure thing! I'm using a YubiKey 5C NFC and a YubiKey 5C on Windows 11 22000.184.

Here's the call stack:

OathSampleCode.dll!Yubico.YubiKey.Sample.OathSampleCode.GetCredentials.RunGetCredentials(Yubico.YubiKey.IYubiKeyDevice yubiKey, System.Func<Yubico.YubiKey.KeyEntryData, bool> KeyCollectorDelegate) Line 31
OathSampleCode.dll!Yubico.YubiKey.Sample.OathSampleCode.OathSampleRun.RunMenuItem(Yubico.YubiKey.Sample.OathSampleCode.OathMainMenuItem menuItem) Line 57
OathSampleCode.dll!Yubico.YubiKey.Sample.OathSampleCode.OathSampleRun.RunSample() Line 67
OathSampleCode.dll!Yubico.YubiKey.Sample.OathSampleCode.StartProgram.Main() Line 22
GregDomzalski commented 2 years ago

Well, we've spotted an issue in the sample code that seems like it could cause the issue you're seeing. We will issue a patch tomorrow. I will update this thread with the commit hash, once it's available.

We also are just starting to test Windows 11 compatibility, so there may be additional issues lurking. This will be an ongoing exercise for us, so please do report back if you run into any more issues.

GregDomzalski commented 2 years ago

Commit 5fb9d98a9a04ccb3a010bcd0091723e0a2890e8e should hopefully address some of the issues you were seeing with this sample code. Please give the latest code a try.

We did also hit another exception with the same callstack as you reported, however it wasn't consistent for us. We're continuing to investigate.

GregDomzalski commented 2 years ago

Closing out old issues.

If this is something you are still encountering and still need assistance, please feel free to re-open this issue.