Skip to content

[BUG] DeleteSlot / DeleteSlotConfiguration throws fault when not failing #182

@virot

Description

@virot

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When calling DeleteSlot(Slot slot), it removes the configuration, but also returns an exception.
System.InvalidOperationException: YubiKey Operation Failed [Warning, state of non-volatile memory is unchanged.] at Yubico.YubiKey.Otp.Operations.DeleteSlotConfiguration.ExecuteOperation() at Yubico.YubiKey.Otp.Operations.OperationBase1.Execute()
at Yubico.YubiKey.Otp.OtpSession.DeleteSlot(Slot slot)`

This is a bit similar to #48, but no COM code involved. I have reduced the issue to a small amount of code..
https://github.com/virot/YubiKeyTests/blob/main/OTP_Remove_throws/Program.cs

If I enable the SDK Debugging code I see the following:
info: Yubico.YubiKey.Oath.OathSession[0] Connecting to Otp info: Yubico.YubiKey.Oath.OathSession[0] Connected to Otp info: Yubico.Core.Devices.Hid.IHidConnection[0] Reading the OTP status. info: Yubico.Core.Devices.Hid.WindowsHidDevice[0] Updating last used for HID:1050:0407 Usage:Keyboard \\?\HID#VID_1050&PID_0407&MI_00#8&57ad29&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}\KBD to 01:27:46.8005131 Configuration state of ShortPress: False warn: Yubico.YubiKey.Oath.OathSession[0] Exception caught when disposing Session: System.NotSupportedException, A YubiOTP APDU was received with instruction number 164. This instruction is not supported.

So it seems that it is doing what should be done, removing the configuration then it throws a fault.

Expected Behavior

It should remove the configuration and dont throw a fault.

Steps To Reproduce

  • Clone / download
  • Build
  • Run with a YubiKey (I have seen this complete on a FW 5.4.3, but then start to fail time after time.)

Version

1.12.1

Version

5.7.1

Anything else?

Works on 5.4.3
image

Fails on 5.7.1
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    added to internal trackerWhen the issue has been added to our internal issue trackerbugSomething isn't workingwipWork in progress

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions