Giter Site home page Giter Site logo

virtual-fido's Introduction

Virtual FIDO

Also check out Bulwark Passkey, a passkey manager based on VirtualFIDO that is currently in beta!

Virtual FIDO is a virtual USB device that implements the FIDO2/U2F protocol (like a YubiKey) to support 2FA and WebAuthN. Please note that this software is still in beta and under active development, so APIs may be subject to change.

Features

  • Support for both Windows and Linux through USB/IP (Mac support coming later)
  • Connect using both U2F and FIDO2 protocols for both normal 2FA and WebAuthN
  • Store credentials in an encrypted format with a passphrase
  • Store credential data anywhere (example provided: a local file)
  • Generic approval mechanism for credential creation and login (example provided: terminal-based)

How it works

Virtual FIDO creates a USB/IP server over local TCP to attach a virtual USB device. This USB device then emulates the USB/CTAP protocols to provide U2F/FIDO services to the host computer. In the demo, credentials created by the virtual device are stored in a local file, and approvals are done using the terminal.

Demo Usage

Go to the YubiKey test page in order to test WebAuthN.

Windows

Run go run ./cmd/demo start to attach the USB device. Run go run ./cmd/demo --help to see more commands, such as to list or delete credentials from the file.

Linux

Note that this tool requires elevated permissions.

  1. Run sudo modprobe vhci-hcd to load the necessary drivers.
  2. Run sudo go run ./cmd/demo start to start up the USB device server. Authenticate when sudo prompts you; this is necessary to attach the device.

virtual-fido's People

Contributors

cmdli avatar jeroenhd avatar vladdoster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

virtual-fido's Issues

Doesn't support the hmac-secret extension, silently ignored

Noting this down in case anyone else spends a few hours bisecting the issue like I did – this means that, for example:
FIDO_EXT_HMAC_SECRET is accepted but doesn't do anything,
a cert created with fido_cred_set_extensions(cert, FIDO_EXT_HMAC_SECRET); fido_dev_make_cred(dev, cred, nullptr); fido_cred_verify(cred) will fail to verify,
fido_assert_set_extensions(assertion, FIDO_EXT_HMAC_SECRET) will make fido_assert_verify(assertion, 0, COSE_ES256, pubkey_parsed) fail,
fido_dev_get_assert(dev, assertion, nullptr); fido_assert_verify(assertion, 0, COSE_ES256, pubkey_parsed) fails as well.

It wasn't obvious this were the case because the systemd FIDO2 driver uses this extension unconditionally, and both YubiKeys and my Somu support it.

Unable to start on Linux

I have trouble running the demo on Linux. From what I can tell, this is looks to be some kind of protocol problem.

As instructed, I have commented out the call to usbip.exe and I'm calling the usbip command manually (usbip attach -r 127.0.0.1 -b 2-2 in a separate terminal). I have modprobed vhci-hcd (the usual driver) without issue. This setup has been used for actual USB/IP work before and it worked surprisingly well.

When I run the demo, I get the following stacktrace from virtual-fido:

$ go run main.go start
panic: ERROR: Could not read data - EOF

goroutine 6 [running]:
virtual_fido.checkErr(...)
        /tmp/virtual-fido/virtual_fido/util.go:22
virtual_fido.readBE[...]({0x7625a0, 0xc000014080})
        /tmp/virtual-fido/virtual_fido/util.go:42 +0x159
virtual_fido.(*USBIPServer).handleCommands(0x7625c0?, 0xc000068a10)
        /tmp/virtual-fido/virtual_fido/usbip_server.go:66 +0x6c
virtual_fido.(*USBIPServer).handleConnection(0xc000012df8, 0xc000068a10)
        /tmp/virtual-fido/virtual_fido/usbip_server.go:58 +0x33a
virtual_fido.(*USBIPServer).start(0x69d100?)
        /tmp/virtual-fido/virtual_fido/usbip_server.go:37 +0x138
virtual_fido.Start({0x765ed8?, 0xc0000303c0})
        /tmp/virtual-fido/virtual_fido/virtual_fido.go:9 +0x365
demo.runServer.func1()
        /tmp/virtual-fido/demo/server.go:76 +0x2a
created by demo.runServer
        /tmp/virtual-fido/demo/server.go:75 +0xa5
exit status 2

In the other terminal, the output is as follows:

$ usbip attach -r 127.0.0.1 -b 2-2
usbip: error: import device

The offending part of the code (usbip_server.go:66) seems to be parsing the incoming command:

func (server *USBIPServer) handleCommands(conn *net.Conn) {
    for {
        //fmt.Printf("--------------------------------------------\n\n")
        header := readBE[USBIPMessageHeader](*conn)  // <---- this is the call that leads to a panic
        usbipLogger.Printf("[MESSAGE HEADER] %s\n\n", header)
        if header.Command == USBIP_COMMAND_SUBMIT {
            server.handleCommandSubmit(conn, header)
        } else if header.Command == USBIP_COMMAND_UNLINK {
            server.handleCommandUnlink(conn, header)
        } else {
            panic(fmt.Sprintf("Unsupported Command; %#v", header))
        }
    }
}

I could be misunderstanding the requirements, but as far as I know the protocol should be compatible (enough) with the Windows version should be compatible?

System info:
Distribution: Manjaro Linux
Go version: go version go1.19 linux/amd64
Kernel version: Linux sue 5.19.7-1-MANJARO
usbip version: usbip (usbip-utils 2.0)
Git branch: master

WebAuthn.io register error

Hi. The driver and virtual device were successfully installed for me. But I get an error when I try to register using the key on https://webauthn.io

Error on the browser side:
The security key cannot be read. Try again.

Error on the emulator side:

C:\Users\Администратор\Downloads\virtual-fido-master\virtual-fido-master>go run ./cmd/demo start
[LOG] Log Level Set: 2
succesfully attached to port 0
[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: CTAPHID_BROADCAST_CHANNEL, Command: ctapHIDCommandInit, PayloadLength: 8 } []byte{0xfd, 0xd2, 0xe, 0x54, 0x5c, 0x2, 0xfd, 0x7f}

[CTAPHID] CTAPHID INIT RESPONSE: ctap_hid.initReponse{Nonce:[8]uint8{0xfd, 0xd2, 0xe, 0x54, 0x5c, 0x2, 0xfd, 0x7f}, NewChannelID:0x1, ProtocolVersion:0x2, DeviceVersionMajor:0x0, DeviceVersionMinor:0x0, DeviceVersionBuild:0x1, CapabilitiesFlags:0x4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x1, Command: ctapHIDCommandCBOR, PayloadLength: 1 } []byte{0x4}

[CTAP] CTAP COMMAND: ctapCommandGetInfo

[CTAP] GET_INFO RESPONSE: ctap.getInfoResponse{Versions:[]string{"FIDO_2_0", "U2F_V2"}, AAGUID:[16]uint8{0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5}, Options:ctap.getInfoOptions{IsPlatform:false, CanResidentKey:true, HasClientPIN:(*bool)(nil), CanUserPresence:true}, PINUVAuthProtocols:[]uint32(nil)}

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x0, 0xa3, 0x1, 0x82, 0x68, 0x46, 0x49, 0x44, 0x4f, 0x5f, 0x32, 0x5f, 0x30, 0x66, 0x55, 0x32, 0x46, 0x5f, 0x56, 0x32, 0x3, 0x50, 0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5, 0x4, 0xa3, 0x62, 0x72, 0x6b, 0xf5, 0x62, 0x75, 0x70, 0xf5, 0x64, 0x70, 0x6c, 0x61, 0x74, 0xf4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: CTAPHID_BROADCAST_CHANNEL, Command: ctapHIDCommandInit, PayloadLength: 8 } []byte{0x76, 0xcb, 0xdf, 0xf6, 0xc, 0xfa, 0x26, 0xa5}

[CTAPHID] CTAPHID INIT RESPONSE: ctap_hid.initReponse{Nonce:[8]uint8{0x76, 0xcb, 0xdf, 0xf6, 0xc, 0xfa, 0x26, 0xa5}, NewChannelID:0x2, ProtocolVersion:0x2, DeviceVersionMajor:0x0, DeviceVersionMinor:0x0, DeviceVersionBuild:0x1, CapabilitiesFlags:0x4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x2, Command: ctapHIDCommandCBOR, PayloadLength: 1 } []byte{0x4}

[CTAP] CTAP COMMAND: ctapCommandGetInfo

[CTAP] GET_INFO RESPONSE: ctap.getInfoResponse{Versions:[]string{"FIDO_2_0", "U2F_V2"}, AAGUID:[16]uint8{0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5}, Options:ctap.getInfoOptions{IsPlatform:false, CanResidentKey:true, HasClientPIN:(*bool)(nil), CanUserPresence:true}, PINUVAuthProtocols:[]uint32(nil)}

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x0, 0xa3, 0x1, 0x82, 0x68, 0x46, 0x49, 0x44, 0x4f, 0x5f, 0x32, 0x5f, 0x30, 0x66, 0x55, 0x32, 0x46, 0x5f, 0x56, 0x32, 0x3, 0x50, 0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5, 0x4, 0xa3, 0x62, 0x72, 0x6b, 0xf5, 0x62, 0x75, 0x70, 0xf5, 0x64, 0x70, 0x6c, 0x61, 0x74, 0xf4}

[CTAPHID] INVALID COMMAND: 1
[CTAPHID] CTAPHID ERROR: ctapHIDErrInvalidCommand

[CTAPHID] CTAPHID: Read 57 bytes, Need 101 more

[CTAPHID] CTAPHID: Read 59 bytes, Need 42 more

add support for Linux USB gadget subsystem

I would like to use virtual-fido on a PinePhone running Linux, providing a virtual FIDO device over USB to my laptop and desktop both also running Linux. Using USB over IP makes that more complicated, since I have to share network between the two devices and then run usbip commands, so I think it would be great if virtual-fido could support the Linux USB gadget subsystem in addition to USB/IP. If you don't have a Linux device capable of gadget mode, the dummy_hcd Linux kernel module can be used to add virtual USB gadgets to your laptop/desktop. I don't know if there is a golang library for Linux USB gadgets, but the @linux-usb-gadgets GitHub org has a C library and command-line tool for this and there is a less maintained D-Bus daemon too, which could be useful on a phone.

https://www.collabora.com/news-and-blog/blog/2019/06/24/using-dummy-hcd/
https://github.com/linux-usb-gadgets/
https://github.com/gadgetd/gadgetd/
https://www.kernel.org/doc/html/latest/usb/gadget_configfs.html

No confirmation request on Linux

I am trying to run demo on Debian 11 but don't see any signs of success. I am expecting a confirmation prompt in terminal after I tap "Next" button on the test page. Is there a way to get error logs to understand what is wrong?

bullseye:0 2022-11-26 20-06-49

./client_usbip.go:16:15: undefined usbip.NewUSBDevice

This error appears when trying to run your project. I have installed go and looked into the code to find that there is no function named NewUSBDevice in usbip? But there is in the usb folder files.

Please help? Why does this not work out-of-the-box, is there something I am missing other than installing Go?

readBE EOF crash with Firefox

Hi there,

Thanks for working on this project! I was trying to get current master to work on my desktop, but using Firefox I'm hitting an error similar to #8. Chromium works just fine.

I'm starting the program which correctly listens on :3240, correctly runs usbip attach as root, and starts spewing some logs (attached). I then head to the test page with Firefox and try to proceed. More logs (attached) are displayed by virtual-fido, but then with a 50% chance it either:

  • does nothing else (hangs?), nothing appears on Firefox's prompt;
  • or crashes with that readBE EOF error (see logs), and sill nothing on Firefox's UI.

Since that behavior does not exist in Chromium, I was wondering if you could give me a hint where to start debugging this. Thanks!

logs.txt

how faithful it is

sorry for the dumb title, and it is NOT an issue, just some questions.
what i want to ask is, how faithful it is to the fido protocol?
and compared to hardware impl., say, yubikey, is the inner working of this implementation about the same?
thanks.

Does virtual-fido work in macos now?

Hi team, I noticed that we now have a virtual driver in macOS. Can this virtual FIDO project work on macOS at the moment? Are there any missing components? Thanks.

Doesn't seem to work on Ubuntu 23.10

I'm not sure if the program is working, since it doesn't seem to do anything whenever I attempt WebAuthn via a browser. I tried closing and reopening the browser and multiple browsers (Firefox and Chromium) to no avail. This is the output I get when running the demo in verbose mode:

[LOG] Log Level Set: 1
[USBIP] Starting USBIP server...
[USBIP] [CONTROL MESSAGE] usbip.USBIPControlHeader{Version:0x111, CommandCode:0x8003, Status:0x0}

                                   [USBIP] [OP_REP_IMPORT] USBIPOpRepImport{ Header: usbip.USBIPControlHeader{Version:0x111, CommandCode:0x3, Status:0x0}, Device: USBIPDeviceSummaryHeader{ Path: "/device/0", BusId: "2-2", Busnum: 2, Devnum 2, Speed 2, IdVendor: 0, IdProduct: 0, BcdDevice: 0x0, BDeviceClass: 0, BDeviceSubclass: 0, BDeviceProtocol: 0, BConfigurationValue: 0, BNumConfigurations: 1, BNumInterfaces: 1} }

                                               [USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 43, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 64, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x100, WIndex: 0, WLength: 64 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x100, WIndex: 0, WLength: 64 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_DEVICE Index: 0

[USB] DEVICE DESCRIPTOR: usbip.USBDeviceDescriptor{BLength:0x12, BDescriptorType:0x1, BcdUSB:0x110, BDeviceClass:0x0, BDeviceSubclass:0x0, BDeviceProtocol:0x0, BMaxPacketSize:0x40, IdVendor:0x0, IdProduct:0x0, BcdDevice:0x1, IManufacturer:0x1, IProduct:0x2, ISerialNumber:0x3, BNumConfigurations:0x1}

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 43, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x40, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 44, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 18, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x100, WIndex: 0, WLength: 18 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x100, WIndex: 0, WLength: 18 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_DEVICE Index: 0

[USB] DEVICE DESCRIPTOR: usbip.USBDeviceDescriptor{BLength:0x12, BDescriptorType:0x1, BcdUSB:0x110, BDeviceClass:0x0, BDeviceSubclass:0x0, BDeviceProtocol:0x0, BMaxPacketSize:0x40, IdVendor:0x0, IdProduct:0x0, BcdDevice:0x1, IManufacturer:0x1, IProduct:0x2, ISerialNumber:0x3, BNumConfigurations:0x1}

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 44, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x12, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 45, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 9, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x200, WIndex: 0, WLength: 9 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x200, WIndex: 0, WLength: 9 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_CONFIGURATION Index: 0

[USB] CONFIGURATION: usbip.USBConfigurationDescriptor{BLength:0x9, BDescriptorType:0x2, WTotalLength:0x29, BNumInterfaces:0x1, BConfigurationValue:0x0, IConfiguration:0x4, BmAttributes:0xc0, BMaxPower:0x0}

INTERFACE: usbip.USBInterfaceDescriptor{BLength:0x9, BDescriptorType:0x4, BInterfaceNumber:0x0, BAlternateSetting:0x0, BNumEndpoints:0x2, BInterfaceClass:0x3, BInterfaceSubclass:0x0, BInterfaceProtocol:0x0, IInterface:0x5}

HID: usbip.USBHIDDescriptor{BLength:0x9, BDescriptorType:0x21, BcdHID:0x101, BCountryCode:0x0, BNumDescriptors:0x1, BClassDescriptorType:0x22, WReportDescriptorLength:0x1e}

[USB] ENDPOINT: usbip.USBEndpointDescriptor{BLength:0x7, BDescriptorType:0x5, BEndpointAddress:0x81, BmAttributes:0x3, WMaxPacketSize:0x40, BInterval:0xff}

[USB] ENDPOINT: usbip.USBEndpointDescriptor{BLength:0x7, BDescriptorType:0x5, BEndpointAddress:0x2, BmAttributes:0x3, WMaxPacketSize:0x40, BInterval:0xff}

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 45, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x9, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 46, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 41, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x200, WIndex: 0, WLength: 41 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x200, WIndex: 0, WLength: 41 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_CONFIGURATION Index: 0

[USB] CONFIGURATION: usbip.USBConfigurationDescriptor{BLength:0x9, BDescriptorType:0x2, WTotalLength:0x29, BNumInterfaces:0x1, BConfigurationValue:0x0, IConfiguration:0x4, BmAttributes:0xc0, BMaxPower:0x0}

INTERFACE: usbip.USBInterfaceDescriptor{BLength:0x9, BDescriptorType:0x4, BInterfaceNumber:0x0, BAlternateSetting:0x0, BNumEndpoints:0x2, BInterfaceClass:0x3, BInterfaceSubclass:0x0, BInterfaceProtocol:0x0, IInterface:0x5}

HID: usbip.USBHIDDescriptor{BLength:0x9, BDescriptorType:0x21, BcdHID:0x101, BCountryCode:0x0, BNumDescriptors:0x1, BClassDescriptorType:0x22, WReportDescriptorLength:0x1e}

[USB] ENDPOINT: usbip.USBEndpointDescriptor{BLength:0x7, BDescriptorType:0x5, BEndpointAddress:0x81, BmAttributes:0x3, WMaxPacketSize:0x40, BInterval:0xff}

[USB] ENDPOINT: usbip.USBEndpointDescriptor{BLength:0x7, BDescriptorType:0x5, BEndpointAddress:0x2, BmAttributes:0x3, WMaxPacketSize:0x40, BInterval:0xff}

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 46, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x29, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 47, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x300, WIndex: 0, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x300, WIndex: 0, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 0

[USB] STRING: Length: 4 Message: "	" Bytes: [4 3 9 4]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 47, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 48, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x302, WIndex: 1033, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x302, WIndex: 1033, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 2

[USB] STRING: Length: 26 Message: "Virtual FIDO" Bytes: [26 3 86 0 105 0 114 0 116 0 117 0 97 0 108 0 32 0 70 0 73 0 68 0 79 0]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 48, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 49, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x301, WIndex: 1033, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x301, WIndex: 1033, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 1

[USB] STRING: Length: 22 Message: "No Company" Bytes: [22 3 78 0 111 0 32 0 67 0 111 0 109 0 112 0 97 0 110 0 121 0]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 49, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 50, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x303, WIndex: 1033, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x303, WIndex: 1033, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 3

[USB] STRING: Length: 34 Message: "No Serial Number" Bytes: [34 3 78 0 111 0 32 0 83 0 101 0 114 0 105 0 97 0 108 0 32 0 78 0 117 0 109 0 98 0 101 0 114 0]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 50, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 51, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x0, TransferBufferLength: 0, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_HOST_TO_DEVICE, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_SET_CONFIGURATION, WValue: 0x0, WIndex: 0, WLength: 0 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_HOST_TO_DEVICE, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_SET_CONFIGURATION, WValue: 0x0, WIndex: 0, WLength: 0 }

[USB] TRANSFER BUFFER: []

[USB] SET_CONFIGURATION: No-op

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 51, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x0, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 52, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x304, WIndex: 1033, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x304, WIndex: 1033, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 4

[USB] STRING: Length: 18 Message: "String 4" Bytes: [18 3 83 0 116 0 114 0 105 0 110 0 103 0 32 0 52 0]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 52, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 53, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x305, WIndex: 1033, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x305, WIndex: 1033, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 5

[USB] STRING: Length: 36 Message: "Default Interface" Bytes: [36 3 68 0 101 0 102 0 97 0 117 0 108 0 116 0 32 0 73 0 110 0 116 0 101 0 114 0 102 0 97 0 99 0 101 0]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 53, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 54, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 255, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x303, WIndex: 1033, WLength: 255 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_DEVICE, BRequest: USB_REQUEST_GET_DESCRIPTOR, WValue: 0x303, WIndex: 1033, WLength: 255 }

[USB] GET DESCRIPTOR: Type: USB_DESCRIPTOR_STRING Index: 3

[USB] STRING: Length: 34 Message: "No Serial Number" Bytes: [34 3 78 0 111 0 32 0 83 0 101 0 114 0 105 0 97 0 108 0 32 0 78 0 117 0 109 0 98 0 101 0 114 0]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 54, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0xff, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 55, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x0, TransferBufferLength: 0, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_HOST_TO_DEVICE, RequestType: USB_REQUEST_CLASS_VENDOR, Recipient: USB_REQUEST_RECIPIENT_INTERFACE, BRequest: USB_HID_REQUEST_SET_IDLE, WValue: 0x0, WIndex: 0, WLength: 0 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_HOST_TO_DEVICE, RequestType: USB_REQUEST_CLASS_VENDOR, Recipient: USB_REQUEST_RECIPIENT_INTERFACE, BRequest: USB_HID_REQUEST_SET_IDLE, WValue: 0x0, WIndex: 0, WLength: 0 }

[USB] TRANSFER BUFFER: []

[USB] SET IDLE: No-op

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 55, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x0, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

[USBIP] [MESSAGE HEADER] USBIPMessageHeader{ Command: USBIP_COMMAND_SUBMIT, SequenceNumber: 56, DeviceID: 2-2, Direction: USBIP_DIR_IN, Endpoint: 0 }

[USBIP] [COMMAND SUBMIT] USBIPCommandSubmitBody{ TransferFlags: 0x200, TransferBufferLength: 30, StartFrame: 0, NumberOfPackets: 0, Interval: 0, Setup: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_INTERFACE, BRequest: USB_HID_REQUEST_GET_DESCRIPTOR, WValue: 0x2200, WIndex: 0, WLength: 30 } }

[USB] USB MESSAGE - ENDPOINT 0

[USB] CONTROL MESSAGE: USBSetupPacket{ Direction: USB_DEVICE_TO_HOST, RequestType: USB_REQUEST_CLASS_STANDARD, Recipient: USB_REQUEST_RECIPIENT_INTERFACE, BRequest: USB_HID_REQUEST_GET_DESCRIPTOR, WValue: 0x2200, WIndex: 0, WLength: 30 }

[USB] GET INTERFACE DESCRIPTOR: Type: USB_DESCRIPTOR_HID_REPORT Index: 0

[USB] HID REPORT: [6 208 241 9 1 161 1 9 32 20 37 255 117 8 149 64 129 2 9 33 20 37 255 117 8 149 64 145 2 192]

[USBIP] [RETURN SUBMIT] USBIPMessageHeader{ Command: USBIP_COMMAND_RET_SUBMIT, SequenceNumber: 56, DeviceID: 2-2, Direction: USBIP_DIR_OUT, Endpoint: 0 } usbip.USBIPReturnSubmitBody{Status:0x0, ActualLength:0x1e, StartFrame:0x0, NumberOfPackets:0x0, ErrorCount:0x0, Padding:0x0}

Regression in 6cb93: Could not decode encrypted box - cbor: cannot unmarshal positive integer

OS: Linux (archlinux)
Browser: Chromium
Working commit: f5702c6
Failing commit: 6cb93bc

Error when authenticating with a website using 6cb93bc (previously registered in vault.json)

panic: ERROR: Could not decode encrypted box - cbor: cannot unmarshal positive integer into Go value of type virtual_fido.encryptedBox

goroutine 135 [running]:
github.com/bulwarkid/virtual-fido/virtual_fido.checkErr(...)
        /virtual_fido/util.go:23
github.com/bulwarkid/virtual-fido/virtual_fido.(*u2fServer).openKeyHandle(0xc000068b00, {0xc0000ce140, 0x10, 0x10})
        /virtual_fido/u2f.go:131 +0x33a
github.com/bulwarkid/virtual-fido/virtual_fido.(*u2fServer).handleU2FAuthenticate(0xc000068b00, {0xd5?, 0x77?, 0x71?, 0x0?}, {0xc0000245a0, 0x51, 0x51})
        /virtual_fido/u2f.go:174 +0x13f
github.com/bulwarkid/virtual-fido/virtual_fido.(*u2fServer).handleU2FMessage(0x40edff?, {0xc0000fc000?, 0x78fea0?, 0x1000000790e20?})
        /virtual_fido/u2f.go:106 +0x24d
github.com/bulwarkid/virtual-fido/virtual_fido.(*ctapHIDChannel).handleDataMessage(0xc0000fc000?, 0x7113cf?, {0x80?, 0x0?, 0x0?}, {0xc0000fc000, 0x5a, 0x80})
        /virtual_fido/ctap_hid.go:341 +0x190
github.com/bulwarkid/virtual-fido/virtual_fido.(*ctapHIDChannel).handleFinalizedMessage(0xc002230040, 0x61c7f2?, {0x7a1c0?, 0xc0?, 0x0?}, {0xc0000fc000, 0x5a, 0x80})
        /virtual_fido/ctap_hid.go:307 +0x147
created by github.com/bulwarkid/virtual-fido/virtual_fido.(*ctapHIDChannel).handleIntermediateMessage
        /virtual_fido/ctap_hid.go:261 +0x36d
exit status 2

Please tell me if you need more verbose logs.

Virtual Fido device demo not working with Yubikey test page (or any other passkey demo page)

Installation steps:

  1. git clone https://github.com/bulwarkid/virtual-fido.git
  2. cd ./cmd/demo/usbip/bin
  3. ./usbip.exe install -w
  4. cd {where we cloned virtual-fido}
  5. go run ./cmd/demo start

List of errors I've encountered at different sites:

image
image

Log output of virtual-fido application:

PS C:\Users\admin\source\repos\Virtual-Authenticator\virtual-fido> go run ./cmd/demo start
[LOG] Log Level Set: 2
succesfully attached to port 0
[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: CTAPHID_BROADCAST_CHANNEL, Command: ctapHIDCommandInit, PayloadLength: 8 } []byte{0x58, 0x5d, 0xa5, 0x7f, 0x7e, 0x75, 0xa1, 0xda}

[CTAPHID] CTAPHID INIT RESPONSE: ctap_hid.initReponse{Nonce:[8]uint8{0x58, 0x5d, 0xa5, 0x7f, 0x7e, 0x75, 0xa1, 0xda}, NewChannelID:0x1, ProtocolVersion:0x2, DeviceVersionMajor:0x0, DeviceVersionMinor:0x0, DeviceVersionBuild:0x1, CapabilitiesFlags:0x4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x1, Command: ctapHIDCommandCBOR, PayloadLength: 1 } []byte{0x4}

[CTAP] CTAP COMMAND: ctapCommandGetInfo

[CTAP] GET_INFO RESPONSE: ctap.getInfoResponse{Versions:[]string{"FIDO_2_0", "U2F_V2"}, AAGUID:[16]uint8{0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5}, Options:ctap.getInfoOptions{IsPlatform:false, CanResidentKey:true, HasClientPIN:(*bool)(nil), CanUserPresence:true}, PINUVAuthProtocols:[]uint32(nil)}

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x0, 0xa3, 0x1, 0x82, 0x68, 0x46, 0x49, 0x44, 0x4f, 0x5f, 0x32, 0x5f, 0x30, 0x66, 0x55, 0x32, 0x46, 0x5f, 0x56, 0x32, 0x3, 0x50, 0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5, 0x4, 0xa3, 0x62, 0x72, 0x6b, 0xf5, 0x62, 0x75, 0x70, 0xf5, 0x64, 0x70, 0x6c, 0x61, 0x74, 0xf4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: CTAPHID_BROADCAST_CHANNEL, Command: ctapHIDCommandInit, PayloadLength: 8 } []byte{0x75, 0x15, 0x92, 0xd9, 0x17, 0x2, 0xe8, 0x1d}

[CTAPHID] CTAPHID INIT RESPONSE: ctap_hid.initReponse{Nonce:[8]uint8{0x75, 0x15, 0x92, 0xd9, 0x17, 0x2, 0xe8, 0x1d}, NewChannelID:0x2, ProtocolVersion:0x2, DeviceVersionMajor:0x0, DeviceVersionMinor:0x0, DeviceVersionBuild:0x1, CapabilitiesFlags:0x4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x2, Command: ctapHIDCommandCBOR, PayloadLength: 1 } []byte{0x4}

[CTAP] CTAP COMMAND: ctapCommandGetInfo

[CTAP] GET_INFO RESPONSE: ctap.getInfoResponse{Versions:[]string{"FIDO_2_0", "U2F_V2"}, AAGUID:[16]uint8{0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5}, Options:ctap.getInfoOptions{IsPlatform:false, CanResidentKey:true, HasClientPIN:(*bool)(nil), CanUserPresence:true}, PINUVAuthProtocols:[]uint32(nil)}

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x0, 0xa3, 0x1, 0x82, 0x68, 0x46, 0x49, 0x44, 0x4f, 0x5f, 0x32, 0x5f, 0x30, 0x66, 0x55, 0x32, 0x46, 0x5f, 0x56, 0x32, 0x3, 0x50, 0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5, 0x4, 0xa3, 0x62, 0x72, 0x6b, 0xf5, 0x62, 0x75, 0x70, 0xf5, 0x64, 0x70, 0x6c, 0x61, 0x74, 0xf4}

usbip: error: vhci driver is not loaded

env -> win10 host,win10 vm
after running "go run ./cmd/demo start" and then an error was reported

[LOG] Log Level Set: 2
usbip: error: vhci driver is not loaded
panic: ERROR: Could not read data - read tcp 127.0.0.1:3240->127.0.0.1:59287: wsarecv: An existing connection was forcibly closed by the remote host.

goroutine 6 [running]:
github.com/bulwarkid/virtual-fido/util.CheckErr(...)
E:/repo/virtual-fido/util/util.go:24
github.com/bulwarkid/virtual-fido/util.ReadBE[...]({0x154ed4c4ff8?, 0xc0000a2010?})
E:/repo/virtual-fido/util/util.go:44 +0x12d
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).handleCommands(0x685b20?, 0xc000086050)
E:/repo/virtual-fido/usbip/usbip_server.go:68 +0x65
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).handleConnection(0xc000098000, 0xc000086050)
E:/repo/virtual-fido/usbip/usbip_server.go:60 +0x49d
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).Start(0x5a72c0?)
E:/repo/virtual-fido/usbip/usbip_server.go:39 +0x12e
github.com/bulwarkid/virtual-fido.startClient({0x689ad8?, 0xc00007abe0})
E:/repo/virtual-fido/client_usbip.go:18 +0x3b6
github.com/bulwarkid/virtual-fido.Start(...)
E:/repo/virtual-fido/virtual_fido.go:18
main.runServer.func1()
E:/repo/virtual-fido/cmd/demo/server.go:78 +0x25
created by main.runServer in goroutine 1
E:/repo/virtual-fido/cmd/demo/server.go:77 +0x93
exit status 2

distribution options / vault backends?

I am wondering how one could reuse the same vault accross multiple systems.
I assume with USBIP one could point multiple virtual-fidos to the same virtual usb stick, albeit not at the same time. If instead a database where used or a vault file on a file share, then with proper locking multiple systems can share the same credentials.
Any thoughts in that direction?
Btw. I don´t really like vault being an encrypted file with the key stored within the same file. Imho calls for more trouble than it solves. I´d prefer to rely on user separation and full disk encryption.

ERROR: Unapproved action (Create account) on passkeys.io

  1. Open Chromium 121.0.6167.139 on Linux
  2. Go to https://www.passkeys.io/
  3. Click "Sign in with a passkey"
  4. The following is output. Typing "Y" and pressing Enter does nothing:
[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: CTAPHID_BROADCAST_CHANNEL, Command: ctapHIDCommandInit, PayloadLength: 8 } []byte{0xb6, 0xed, 0x53, 0x1d, 0x83, 0x38, 0x19, 0x54}

[CTAPHID] CTAPHID INIT RESPONSE: ctap_hid.initReponse{Nonce:[8]uint8{0xb6, 0xed, 0x53, 0x1d, 0x83, 0x38, 0x19, 0x54}, NewChannelID:0x5, ProtocolVersion:0x2, DeviceVersionMajor:0x0, DeviceVersionMinor:0x0, DeviceVersionBuild:0x1, CapabilitiesFlags:0x4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x5, Command: ctapHIDCommandCBOR, PayloadLength: 1 } []byte{0x4}

[CTAP] CTAP COMMAND: ctapCommandGetInfo

[CTAP] GET_INFO RESPONSE: ctap.getInfoResponse{Versions:[]string{"FIDO_2_0", "U2F_V2"}, AAGUID:[16]uint8{0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5}, Options:ctap.getInfoOptions{IsPlatform:false, CanResidentKey:true, HasClientPIN:(*bool)(nil), CanUserPresence:true}, PINUVAuthProtocols:[]uint32(nil)}

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x0, 0xa3, 0x1, 0x82, 0x68, 0x46, 0x49, 0x44, 0x4f, 0x5f, 0x32, 0x5f, 0x30, 0x66, 0x55, 0x32, 0x46, 0x5f, 0x56, 0x32, 0x3, 0x50, 0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5, 0x4, 0xa3, 0x62, 0x72, 0x6b, 0xf5, 0x62, 0x75, 0x70, 0xf5, 0x64, 0x70, 0x6c, 0x61, 0x74, 0xf4}

[CTAPHID] CTAPHID: Read 57 bytes, Need 34 more

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x5, Command: ctapHIDCommandCBOR, PayloadLength: 91 } []byte{0x1, 0xa4, 0x1, 0x58, 0x20, 0xe3, 0xb0, 0xc4, 0x42, 0x98, 0xfc, 0x1c, 0x14, 0x9a, 0xfb, 0xf4, 0xc8, 0x99, 0x6f, 0xb9, 0x24, 0x27, 0xae, 0x41, 0xe4, 0x64, 0x9b, 0x93, 0x4c, 0xa4, 0x95, 0x99, 0x1b, 0x78, 0x52, 0xb8, 0x55, 0x2, 0xa1, 0x62, 0x69, 0x64, 0x66, 0x2e, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x3, 0xa2, 0x62, 0x69, 0x64, 0x41, 0x1, 0x64, 0x6e, 0x61, 0x6d, 0x65, 0x65, 0x64, 0x75, 0x6d, 0x6d, 0x79, 0x4, 0x81, 0xa2, 0x63, 0x61, 0x6c, 0x67, 0x26, 0x64, 0x74, 0x79, 0x70, 0x65, 0x6a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x6b, 0x65, 0x79}

[CTAP] CTAP COMMAND: ctapCommandMakeCredential

[CTAP] MAKE CREDENTIAL: ctapMakeCredentialArgs{ ClientDataHash: 0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, Relying Party: RPEntity{ ID: .dummy, Name:  }, User: User{ ID: 01, DisplayName: , Name: dummy }, PublicKeyCredentialParams: []webauthn.PublicKeyCredentialParams{webauthn.PublicKeyCredentialParams{Type:"public-key", Algorithm:-7}}, ExcludeList: []webauthn.PublicKeyCredentialDescriptor(nil), Extensions: map[string]interface {}(nil), Options: (*ctap.makeCredentialOptions)(nil), PinAuth: []byte(nil), PinProtocol: 0 }

Approve account creation for "" (Y/n)?
--> [CTAP] ERROR: Unapproved action (Create account)
[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x27}

Also having problems in Firefox 122.0.1, where I receive the following output:

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: CTAPHID_BROADCAST_CHANNEL, Command: ctapHIDCommandInit, PayloadLength: 8 } []byte{0x2d, 0x52, 0x20, 0x11, 0xe0, 0x82, 0x65, 0x5e}

[CTAPHID] CTAPHID INIT RESPONSE: ctap_hid.initReponse{Nonce:[8]uint8{0x2d, 0x52, 0x20, 0x11, 0xe0, 0x82, 0x65, 0x5e}, NewChannelID:0x6, ProtocolVersion:0x2, DeviceVersionMajor:0x0, DeviceVersionMinor:0x0, DeviceVersionBuild:0x1, CapabilitiesFlags:0x4}

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x6, Command: ctapHIDCommandCBOR, PayloadLength: 1 } []byte{0x4}

[CTAP] CTAP COMMAND: ctapCommandGetInfo

[CTAP] GET_INFO RESPONSE: ctap.getInfoResponse{Versions:[]string{"FIDO_2_0", "U2F_V2"}, AAGUID:[16]uint8{0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5}, Options:ctap.getInfoOptions{IsPlatform:false, CanResidentKey:true, HasClientPIN:(*bool)(nil), CanUserPresence:true}, PINUVAuthProtocols:[]uint32(nil)}

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x0, 0xa3, 0x1, 0x82, 0x68, 0x46, 0x49, 0x44, 0x4f, 0x5f, 0x32, 0x5f, 0x30, 0x66, 0x55, 0x32, 0x46, 0x5f, 0x56, 0x32, 0x3, 0x50, 0x75, 0x6c, 0x5a, 0xf5, 0xec, 0xa6, 0x1, 0xa3, 0x2f, 0xc6, 0xd3, 0xc, 0xe2, 0xf2, 0x1, 0xc5, 0x4, 0xa3, 0x62, 0x72, 0x6b, 0xf5, 0x62, 0x75, 0x70, 0xf5, 0x64, 0x70, 0x6c, 0x61, 0x74, 0xf4}

[CTAPHID] CTAPHID: Read 57 bytes, Need 3 more

[CTAPHID] CTAPHID FINALIZED MESSAGE: CTAPHIDMessageHeader{ ChannelID: 0x6, Command: ctapHIDCommandCBOR, PayloadLength: 60 } []byte{0x2, 0xa3, 0x1, 0x6f, 0x77, 0x77, 0x77, 0x2e, 0x70, 0x61, 0x73, 0x73, 0x6b, 0x65, 0x79, 0x73, 0x2e, 0x69, 0x6f, 0x2, 0x58, 0x20, 0x61, 0x3c, 0x41, 0xc3, 0x37, 0xf9, 0x9, 0x57, 0x2b, 0x1, 0x2a, 0x1a, 0xc5, 0xeb, 0x3d, 0x19, 0x50, 0xb9, 0xc6, 0xac, 0xbb, 0xb5, 0xe4, 0x4b, 0x89, 0x8e, 0x2c, 0x2f, 0xf, 0x23, 0x6f, 0xe2, 0x5, 0xa1, 0x62, 0x75, 0x70, 0xf5}

[CTAP] CTAP COMMAND: ctapCommandGetAssertion

[CTAP] GET ASSERTION: ctap.getAssertionArgs{RPID:"www.passkeys.io", ClientDataHash:[]uint8{0x61, 0x3c, 0x41, 0xc3, 0x37, 0xf9, 0x9, 0x57, 0x2b, 0x1, 0x2a, 0x1a, 0xc5, 0xeb, 0x3d, 0x19, 0x50, 0xb9, 0xc6, 0xac, 0xbb, 0xb5, 0xe4, 0x4b, 0x89, 0x8e, 0x2c, 0x2f, 0xf, 0x23, 0x6f, 0xe2}, AllowList:[]webauthn.PublicKeyCredentialDescriptor(nil), Options:ctap.getAssertionOptions{UserVerification:false, UserPresence:(*bool)(0xc0000eae28)}, PINUVAuthParam:[]uint8(nil), PINUVAuthProtocol:0x0}

[CLIENT] ERROR: No Credentials

[CTAP] ERROR: No Credentials

[CTAPHID] CTAPHID CBOR RESPONSE: []byte{0x2e}

demo: `undefined: platformUSBIPExec` on Linux

I cannot run the demo (on the latest master, commit 2ebf6ee) on Ubuntu 22.04.2.

Maybe I am missing something, but when I run sudo go run ./cmd/demo start I get:

# github.com/bulwarkid/virtual-fido/cmd/demo
cmd/demo/server.go:83:11: undefined: platformUSBIPExec

Looks like platformUSBIPExec is only implemented in exec_windows.go?

usbip command not found issue and how to resolve

Hi!

Not an issue, just a suggestion to add to the README.

First of all, I like your project!
Just had some issue when starting up on Linux OS.
It seems that usbip is not always installed and doing apt-get install usbip does not work.

Here is some instructions on how to get usbip installed:

sudo apt install linux-tools-virtual hwdata
sudo update-alternatives --install /usr/local/bin/usbip usbip `ls /usr/lib/linux-tools/*/usbip | tail -n1` 20

Got it from this page: https://github.com/dorssel/usbipd-win/wiki/WSL-support

crash with "panic: Invalid USB Interface bRequest: 9" when faced with linux hidraw sample code

With Linux 6.8 samples/hidraw/hid-example.c, I get

$ sudo ./demo start
[LOG] Log Level Set: 2
panic: Invalid USB Interface bRequest: 9

goroutine 9 [running]:
github.com/bulwarkid/virtual-fido/usbip.(*USBDeviceImpl).handleInterfaceRequest(0xc00009a280?, {0x21, 0x9, 0x309, 0x0, 0x4}, {0xc00221e21c?, 0xc0001a3420?, 0x5798dd?})
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usb_device.go:264 +0x359
github.com/bulwarkid/virtual-fido/usbip.(*USBDeviceImpl).handleControlMessage(0xc00009a280?, {0x21, 0x9, 0x309, 0x0, 0x4}, {0xc00221e21c, 0x4, 0x4})
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usb_device.go:276 +0x145
github.com/bulwarkid/virtual-fido/usbip.(*USBDeviceImpl).handleMessage(0xc000016860, 0x373, 0xc002240000, 0x0, {0x21, 0x9, 0x309, 0x0, 0x4}, {0xc00221e21c, ...})
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usb_device.go:305 +0x205
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).handleCommandSubmit(0xc0000124b0, 0xc00007acd0, {0x1, 0x373, 0x20002, 0x0, 0x0})
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usbip_server.go:115 +0x31a
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).handleCommands(0x7a08a0?, 0xc00007acd0)
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usbip_server.go:71 +0x165
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).handleConnection(0xc0000124b0, 0xc00007acd0)
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usbip_server.go:60 +0x33a
github.com/bulwarkid/virtual-fido/usbip.(*USBIPServer).Start(0x6cdb40?)
        /home/nabijaczleweli/uwu/virtual-fido/usbip/usbip_server.go:39 +0x138
github.com/bulwarkid/virtual-fido.startClient({0x7a4738?, 0xc000000be0})
        /home/nabijaczleweli/uwu/virtual-fido/client_usbip.go:18 +0x3b0
github.com/bulwarkid/virtual-fido.Start(...)
        /home/nabijaczleweli/uwu/virtual-fido/virtual_fido.go:18
main.runServer.func1()
        /home/nabijaczleweli/uwu/virtual-fido/cmd/demo/server.go:78 +0x2b
created by main.runServer
        /home/nabijaczleweli/uwu/virtual-fido/cmd/demo/server.go:77 +0xa5

corresponding to

$ sudo strace -o ss ./hid-example /dev/hidraw1
Report Descriptor Size: 30
Report Descriptor:
6 d0 f1 9 1 a1 1 9 20 14 25 ff 75 8 95 40 81 2 9 21 14 25 ff 75 8 95 40 91 2 c0

Raw Name: No Company Virtual FIDO
Raw Phys: usb-vhci_hcd.0-1/input0
Raw Info:
        bustype: 3 (USB)
        vendor: 0x0000
        product: 0x0000
HIDIOCSFEATURE: Connection timed out
HIDIOCGFEATURE: No such device
Error: 19
write: No such device
read: Input/output error

and

$ cat ss
execve("./hid-example", ["./hid-example", "/dev/hidraw1"], 0x7fff00acf8f8 /* 15 vars */) = 0
brk(NULL)                               = 0x556dd50d6000
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c453000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
newfstatat(3, "", {st_mode=S_IFREG|0644, st_size=84206, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 84206, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1a7c43e000
close(3)                                = 0
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220s\2\0\0\0\0\0"..., 832) = 832
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
newfstatat(3, "", {st_mode=S_IFREG|0755, st_size=1922136, ...}, AT_EMPTY_PATH) = 0
pread64(3, "\6\0\0\0\4\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0@\0\0\0\0\0\0\0"..., 784, 64) = 784
mmap(NULL, 1970000, PROT_READ, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f1a7c25d000
mmap(0x7f1a7c283000, 1396736, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x26000) = 0x7f1a7c283000
mmap(0x7f1a7c3d8000, 339968, PROT_READ, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17b000) = 0x7f1a7c3d8000
mmap(0x7f1a7c42b000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1ce000) = 0x7f1a7c42b000
mmap(0x7f1a7c431000, 53072, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c431000
close(3)                                = 0
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f1a7c25a000
arch_prctl(ARCH_SET_FS, 0x7f1a7c25a740) = 0
set_tid_address(0x7f1a7c25aa10)         = 3544323
set_robust_list(0x7f1a7c25aa20, 24)     = 0
rseq(0x7f1a7c25b060, 0x20, 0, 0x53053053) = 0
mprotect(0x7f1a7c42b000, 16384, PROT_READ) = 0
mprotect(0x556dd398d000, 4096, PROT_READ) = 0
mprotect(0x7f1a7c485000, 8192, PROT_READ) = 0
prlimit64(0, RLIMIT_STACK, NULL, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
munmap(0x7f1a7c43e000, 84206)           = 0
openat(AT_FDCWD, "/dev/hidraw1", O_RDWR|O_NONBLOCK) = 3
ioctl(3, HIDIOCGRDESCSIZE or HIDIOCGVERSION, 0x7ffd6595bdb0) = 0
newfstatat(1, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x8), ...}, AT_EMPTY_PATH) = 0
getrandom("\x72\xd1\xb8\x1e\xb8\xca\x1c\xfc", 8, GRND_NONBLOCK) = 8
brk(NULL)                               = 0x556dd50d6000
brk(0x556dd50f7000)                     = 0x556dd50f7000
write(1, "Report Descriptor Size: 30\n", 27) = 27
ioctl(3, HIDIOCGRDESC, 0x7ffd6595acac)  = 0
write(1, "Report Descriptor:\n", 19)    = 19
write(1, "6 d0 f1 9 1 a1 1 9 20 14 25 ff 7"..., 81) = 81
write(1, "\n", 1)                       = 1
ioctl(3, HIDIOCGRAWNAME(256), 0x7ffd6595bcb0) = 24
write(1, "Raw Name: No Company Virtual FID"..., 34) = 34
ioctl(3, HIDIOCGRAWPHYS(256), 0x7ffd6595bcb0) = 24
write(1, "Raw Phys: usb-vhci_hcd.0-1/input"..., 34) = 34
ioctl(3, HIDIOCGRAWINFO, 0x7ffd6595aca4) = 0
write(1, "Raw Info:\n", 10)             = 10
write(1, "\tbustype: 3 (USB)\n", 18)    = 18
write(1, "\tvendor: 0x0000\n", 16)      = 16
write(1, "\tproduct: 0x0000\n", 17)     = 17
ioctl(3, HIDIOCSFEATURE(4), 0x7ffd6595bcb0) = -1 ETIMEDOUT (Connection timed out)
dup(2)                                  = 4
fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
newfstatat(4, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x8), ...}, AT_EMPTY_PATH) = 0
write(4, "HIDIOCSFEATURE: Connection timed"..., 37) = 37
close(4)                                = 0
ioctl(3, HIDIOCGFEATURE(256), 0x7ffd6595bcb0) = -1 ENODEV (No such device)
dup(2)                                  = 4
fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
newfstatat(4, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x8), ...}, AT_EMPTY_PATH) = 0
write(4, "HIDIOCGFEATURE: No such device\n", 31) = 31
close(4)                                = 0
write(3, "\1w", 2)                      = -1 ENODEV (No such device)
write(1, "Error: 19\n", 10)             = 10
dup(2)                                  = 4
fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
newfstatat(4, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x8), ...}, AT_EMPTY_PATH) = 0
write(4, "write: No such device\n", 22) = 22
close(4)                                = 0
read(3, 0x7ffd6595bcb0, 16)             = -1 EIO (Input/output error)
dup(2)                                  = 4
fcntl(4, F_GETFL)                       = 0x2 (flags O_RDWR)
newfstatat(4, "", {st_mode=S_IFCHR|0620, st_rdev=makedev(0x88, 0x8), ...}, AT_EMPTY_PATH) = 0
write(4, "read: Input/output error\n", 25) = 25
close(4)                                = 0
close(3)                                = 0
exit_group(0)                           = ?
+++ exited with 0 +++

Running on windows?

I installed Go Windows and cloned the project today. When running the demo, I am getting the error:

C:\Users\Joachim\Desktop\virtfido\virtual-fido>go run ./cmd/demo start
usbip: error: vhci driver is not loaded
panic: ERROR: Could not read data - read tcp 127.0.0.1:3240->127.0.0.1:57812: wsarecv: An existing connection was forcibly closed by the remote host.

goroutine 6 [running]:
github.com/bulwarkid/virtual-fido/virtual_fido.checkErr(...)
C:/Users/Joachim/Desktop/virtfido/virtual-fido/virtual_fido/util.go:22
github.com/bulwarkid/virtual-fido/virtual_fido.readBE[...]({0x26ce7fa8158, 0xc00000a078})
C:/Users/Joachim/Desktop/virtfido/virtual-fido/virtual_fido/util.go:42 +0x159
github.com/bulwarkid/virtual-fido/virtual_fido.(*usbIPServer).handleCommands(0xcddb60?, 0xc000040a50)
C:/Users/Joachim/Desktop/virtfido/virtual-fido/virtual_fido/usbip_server.go:66 +0x6c
github.com/bulwarkid/virtual-fido/virtual_fido.(*usbIPServer).handleConnection(0xc000008e70, 0xc000040a50)
C:/Users/Joachim/Desktop/virtfido/virtual-fido/virtual_fido/usbip_server.go:58 +0x33a
github.com/bulwarkid/virtual-fido/virtual_fido.(*usbIPServer).start(0xc09380?)
C:/Users/Joachim/Desktop/virtfido/virtual-fido/virtual_fido/usbip_server.go:37 +0x138
github.com/bulwarkid/virtual-fido/virtual_fido.Start({0xce12e0?, 0xc00004c240})
C:/Users/Joachim/Desktop/virtfido/virtual-fido/virtual_fido/virtual_fido.go:9 +0x365
main.runServer.func1()
C:/Users/Joachim/Desktop/virtfido/virtual-fido/cmd/demo/server.go:77 +0x2a
created by main.runServer
C:/Users/Joachim/Desktop/virtfido/virtual-fido/cmd/demo/server.go:76 +0xa5
exit status 2

what am I doing wrong?
Thanks, Joachim

User interface for approvals?

I tried the https://demo.yubico.com/webauthn-technical/registration with virtual-fido on windows. The user experience right now is working but rudimentary - touching the stick as requested by the page in firefox requires pressing Y in the console I used to start the demo.
Do you have ideas on how to make this more user friendly? Could this be approval be automatic, and if yes, what are pros and cons? Or a windows notification approve site yes/no? I assume the specific means to implement a user interface are OS-dependent. On windows I would assume the usb and virtual fido parts could end up in services, that could trigger an approval ui. As I already wrote services and notifications (C#) I could probably contribute some parts, but guidance on what and how highly appreciated.

non-existent bus id: 2-2

When I ran command go run .\cmd\demo start on Windows 10, I got the following error:
usbip: error: non-existent bus id: 2-2 Error: exit status 3
Does it because the virtual usb device didn't created?
how can I find why?

maybe enable discussions?

I was just giving this a try on windows. But I have issues getting this to work, if I access this yubi test page, I am only getting the windows popup to insert my device, nothing happens if I insert or remove a usb drive.

  • maybe instruction on how to create an usb drive on linux and how it also can be used on windows?
  • maybe describe the process? I assume/from your howto: windows searches for fido device, it finds your virtual driver the virtual driver connects to usbip-win on this 3240 port, that has some logic that checks the attached usb device and reports back to windows if the authentication is ok. Is that correct? When is the procedure initialized to provision some usb pen drive?
  • why is usbip-win running on 0:0:0:0 and not 127:0:0:1?
  • I have unclear entries in the windows firewall for bullshark passkey, why does it need so much access, does it not only need to connect to usbip-win on localhost with this 3240?
  • I don't really get how I initialize the usb drive
  • Is it possible to use only part of the usb drive like a partition or just a key file on a partition?
  • when I start Passkey, it constantly asks for admin privileges, do I even need this?
  • passkey is doing nothing, yet starting multiple process with megabytes.
    process

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.