bulwarkid / virtual-fido

A Virtual FIDO2 USB Device
MIT License
1.22k stars 56 forks source link

add support for Linux USB gadget subsystem #1

Open pabs3 opened 2 years ago

pabs3 commented 2 years ago

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