-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event-based Transport/Token API / USB HID rewrite #324
Conversation
Looking really good <3 |
This is getting pretty large, is there anything blocking it from merging? since we aren't planning to release just yet, did you want to rebase/commit and continue? What else do you think needs to be done? |
I think this is pretty close to done, but there are still some broken things that I'm working through on the checklist. I'll probably split off some of the smaller things which aren't directly related to the rewrite into a separate PR; I just needed somewhere to stash notes for now. |
* WIP: windows usb hid * basic windows HID works * break things * windows usb hotplug works! * cleanup error handlers * another stray error * guard USB support * document and tidy some things * add platforms * start macos support * start wrapping types * mac: hanging thread * mac: needs a little more wires... * event propagates * mac: basics working, next is cleanup * mac: unregister event handlers from correct thread * mac: add synthetic enumeration_completed event * mac: cleanup and improve tests * more cleaning * mac: more tidying, removed unneeded code... * mac: reorganising functions * mac: implement get_devices, remove debugging messages, more tidying * mac: move IOHIDManager methods into impl * mac: move methods into IOHIDHevice * mac: replace enums * mac: un-rename iohid symbols * remove unused import * start implementing linux * rewrite descriptor parser to iterator model * linux: update notes, remove unneeded code * linux: implement device discovery * linux: denoise * use kernel definitions for types * tidying, start rewriting fido-key-manager * clean up some types, document linux behaviour * nfc: start refactoring, add `info --watch` mode * nfc: less noise * fix up some NFC stuff, ignore silly readers * nfc: improve enumeration * start implementing bluetooth support again, fixing up a stupid macos PIV problem * macos: clean up a bunch of imports and usage of std::thread * delete a bunch of unused code * split platform-specific USB HID code into its own library (WIP) * tidy tidy * exclude fido-hid-rs from first doc pass * fixup linux issues, move errors into own file * more tidying * spawn_blocking on linux * cleanup mac stuff * clean up some dependency chains * add dbus * fix up clippy * fake bluetooth events * start migrating authenticate example * WIP: macos broken, refactoring... * refactor mac code to keep manager alive * cleanup more mac stuff * mac: delete more unneeded code * typo * fixup windows * fixup linux * docs updates, bluetooth tweaking * fixup linux crosscompile * linux again * more linux * Migrate NFC conformance test to new API * tidy up conformance tests * update cable_tunnel example for new API * start implementing selection, roll back Transport name changes * improve some windows things * document selection * type fun * migrate more comands * blah * start openssl notes * fido-key-manager: migrate fingerprints to new api * add remaining fido-key-manager commands * handle wine NFC stubs * quiet clippy * nfc stubs fix * format code, * fix up a bunch of broken * cleanup more lint issues
This rewrites most of the Transport/Token API to be event based (#214), and in the process, replaces
hidapi
with a homebrew implementation. The branch is calledmozilla-hid
because my original plan was to base it onauthenticator-rs
, but in the end I've rewritten most of that.I'm only targetting Linux, macOS and Windows for now.
Main changes:
New USB HID API bindings (
fido-hid-rs
):hidapi
andauthenticator-rs
used the older Windows 2000 APIs which are not async friendlyAdd event-based API for device enumeration (
Transport::watch_tokens()
), moved Bluetooth and NFC transports to it.This is now the only way to enumerate tokens for Bluetooth.
Started adding Bluetooth support to
fido-key-manager
. This is only really reliable on macOS at the moment.NFC: work around a bug where macOS' login manager tries to access the PIV applet on tokens that we have an exclusive connection to, which causes some tokens to reset (if the command arrives after
SELECT FIDO
but before other commands).Implement selection for CTAP 2.0/2.1-PRE authenticators
TODO list:
std::thread