[PATCH 1/4] hw/usb/u2f: Add `start` and `stop` callbacks to U2F key class

2024-06-25 Thread David Bouman
unlinked/stopped. For a Linux guest, the start callback corresponds to the `hid_hw_open` and `hid_hw_close` routines, invoked whenever the first user opens, respectively the last user closes the emulated hidraw device. Signed-off-by: David Bouman --- hw/usb/u2f.c | 23 +++ hw/usb

[PATCH 2/4] hw/usb/u2f-passthru: Do not needlessly retain handle to hidraw chardev

2024-06-25 Thread David Bouman
the guest stops using it (stop callback). Signed-off-by: David Bouman Fixes: 299976b050bf (hw/usb: Add U2F key passthru mode) --- hw/usb/u2f-passthru.c | 84 +++ 1 file changed, 61 insertions(+), 23 deletions(-) diff --git a/hw/usb/u2f-passthru.c b/

[PATCH 4/4] hw/usb/u2f-passthru: Implement FIDO U2FHID keep-alive

2024-06-25 Thread David Bouman
prevents some U2F security keys from being passed through correctly (Yubikey 4/5). Fix this by recognizing the keep-alive response and, if received, by keeping the transaction alive regardless of the resp_bcnt limit. Signed-off-by: David Bouman Fixes: 299976b050bf (hw/usb: Add U2F key passthru mode

[PATCH 3/4] hw/usb/u2f-passthru: Clean up code

2024-06-25 Thread David Bouman
Prepare for implementing the FIDO-U2F keepalive feature: Represent all u2fhid frames using one coherent structure, and make casts explicit. Signed-off-by: David Bouman --- hw/usb/u2f-passthru.c | 73 ++- 1 file changed, 44 insertions(+), 29 deletions

[PATCH 0/4] hw/usb/u2f-passthru: U2F keepalive fixes

2024-06-25 Thread David Bouman
EMU. Happy to hear your feedback! David Bouman (4): hw/usb/u2f: Add `start` and `stop` callbacks to U2F key class hw/usb/u2f-passthru: Do not needlessly retain handle to hidraw chardev hw/usb/u2f-passthru: Clean up code hw/usb/u2f-passthru: Implement FIDO U2FHID keep-alive hw/usb/u2f-