Comments (3)
Hi @jcjones!
Thank you for your work on the authenticator and enabling CTAP support within Mozilla.
Maybe this issue is stale, but I am posting here to offer some feedback on it and also get your opinion / input.
One way to support Bluetooth "out-of-the-box" is via HID over Bluetooth Profile support. Given the current implementation this requires the dynamic management of the HID_RPT_SIZE
, which to the best of my knowledge is actually not pinned to 64 bytes anyway by the CTAP HID spec. 64 is just the best one can do. Handling HID_RPT_SIZE
dynamically would require to parse the descriptor FIDO_INPUT, FIDO_OUTPUT and compute it from there for each HID device. This is needed to account for the varying MTU capabilities of Bluetooth L2CAP allowing interoperability between devices and hosts.
One other issue is the fact that libc read/write (on linux at least) may return 0 bytes on read/write operations for HID over Bluetooth devices depending on the profile implementation, which is inline with the documentation of since the file descriptors (/dev/hidraw*
) belong in fact to character device type and not regular files. So this may be trickier to handle nicely since the strong checks now in the code will not be asserted.
What do you think about this approach given your superior understanding of the code base ?
I would offer to help implementing this but I am by no means a Rust user :(. I just got to this point by debugging why a custom made HID Bluetooth FIDO2/U2F authenticator tested with Chrome, Edge on multi-platforms (Mac, Linux, Windows) would not work on Mozilla in Linux.
Cheers,
Andrei
from authenticator-rs.
@rstoica Great to see somebody else interested in this.
One way to support Bluetooth "out-of-the-box" is via HID over Bluetooth Profile support.
I don't know what @jcjones had in mind when this issue was created, but I think that it was meant to be about adding support for Bluetooth CTAP transport, not Bluetooth HID transport. That said, Bluetooth HID transport is certainly much easier to add.
Given the current implementation this requires the dynamic management of the
HID_RPT_SIZE
, which to the best of my knowledge is actually not pinned to 64 bytes anyway by the CTAP HID spec. 64 is just the best one can do. HandlingHID_RPT_SIZE
dynamically would require to parse the descriptor FIDO_INPUT, FIDO_OUTPUT and compute it from there for each HID device. This is needed to account for the varying MTU capabilities of Bluetooth L2CAP allowing interoperability between devices and hosts.
I have a PR that does most of what's needed for that (#112), but could certainly be improved. I have not received any comments on it yet, but would gladly work them in.
One other issue is the fact that libc read/write (on linux at least) may return 0 bytes on read/write operations for HID over Bluetooth devices depending on the profile implementation, which is inline with the documentation of since the file descriptors (
/dev/hidraw*
) belong in fact to character device type and not regular files. So this may be trickier to handle nicely since the strong checks now in the code will not be asserted.
Do you happen to know which profiles would still return 0? I tried to get this changed in the kernel so that hidraw would behave uniformly between USB and Bluetooth transport, but I'm not very knowledgeable about the kernel and drivers.
I would offer to help implementing this but I am by no means a Rust user :(. I just got to this point by debugging why a custom made HID Bluetooth FIDO2/U2F authenticator tested with Chrome, Edge on multi-platforms (Mac, Linux, Windows) would not work on Mozilla in Linux.
Just in case you want to give it a try: Chrome OS should also support Bluetooth HID authenticators starting with the current Beta 84.0.4147.51 / 13099.41.0.
from authenticator-rs.
@rstoica Great to see somebody else interested in this.
One way to support Bluetooth "out-of-the-box" is via HID over Bluetooth Profile support.
I don't know what @jcjones had in mind when this issue was created, but I think that it was meant to be about adding support for Bluetooth CTAP transport, not Bluetooth HID transport. That said, Bluetooth HID transport is certainly much easier to add.
True, figured that out, Bluetooth HIDP is just one way to go about and closest delta in terms of Bluetooth support with current code base.
Given the current implementation this requires the dynamic management of the
HID_RPT_SIZE
, which to the best of my knowledge is actually not pinned to 64 bytes anyway by the CTAP HID spec. 64 is just the best one can do. HandlingHID_RPT_SIZE
dynamically would require to parse the descriptor FIDO_INPUT, FIDO_OUTPUT and compute it from there for each HID device. This is needed to account for the varying MTU capabilities of Bluetooth L2CAP allowing interoperability between devices and hosts.I have a PR that does most of what's needed for that (#112), but could certainly be improved. I have not received any comments on it yet, but would gladly work them in.
Cool, that is what I had also in mind regarding the dynamic management of the HID frame length. But as I mentioned, I am afraid this may be not sufficient to support Bluetooth as one has to handle the read/write returns of this transport layer within the authenticator logic.
One other issue is the fact that libc read/write (on linux at least) may return 0 bytes on read/write operations for HID over Bluetooth devices depending on the profile implementation, which is inline with the documentation of since the file descriptors (
/dev/hidraw*
) belong in fact to character device type and not regular files. So this may be trickier to handle nicely since the strong checks now in the code will not be asserted.Do you happen to know which profiles would still return 0? I tried to get this changed in the kernel so that hidraw would behave uniformly between USB and Bluetooth transport, but I'm not very knowledgeable about the kernel and drivers.
Here is the arch of the HID transport in Linux. In terms of the Bluetooth, from a very brief look it seems that only HIDP is supported within the kernel as a transport layer for the HID. The alternative HOGP is within BlueZ, but I did not see any link to the HID core. The HIDP is I/O is handled by L2CAP layer via sockets, and is implemented based on wait queues and interrupts (as it should) to handle the Bluetooth connections and wireless access. Here is the HIDP write
inner part if you have any interest to look into it.
I would offer to help implementing this but I am by no means a Rust user :(. I just got to this point by debugging why a custom made HID Bluetooth FIDO2/U2F authenticator tested with Chrome, Edge on multi-platforms (Mac, Linux, Windows) would not work on Mozilla in Linux.
Just in case you want to give it a try: Chrome OS should also support Bluetooth HID authenticators starting with the current Beta 84.0.4147.51 / 13099.41.0.
Nice to hear that. Will give it a look.
from authenticator-rs.
Related Issues (20)
- Using TouchID as a security key - MacOS HOT 1
- Get rid of nom? HOT 1
- Pre-flighting breaks AppID support HOT 1
- Select a reasonable default pin protocol when `pinUvAuthProtocols` is absent from GetInfo response HOT 1
- Access Raw Auth Data HOT 2
- FIDO_2_0 devices with no pin set - experiencing unexpected make credential behavior HOT 7
- Rewrite tests that use mock devices
- Consider only blinking useful tokens from DeviceSelector
- Add AuthenticatorData::to_writer
- Get rid of bitflags
- Avoid clippy randomly breaking the CI HOT 1
- Add a status update to tell the user to connect a device HOT 1
- Inconsistent Serialization/Deserialization Behavior with Empty Extension Data in attestation.rs HOT 1
- Wrongly enforces getAssertion credential (0x01) member presence in the authenticator response, which is optional in FIDO2 HOT 10
- Support Hybrid Transport / caBLE
- Dependency serde_cbor is unmaintained HOT 2
- USB transport isn't working and always showing passkey as the first option HOT 2
- AppId Extension is broken again for FIDO2 security keys in Firefox 122 HOT 10
- Broken since last April with SoloKeys (v1) HOT 5
- [Bug] Registration fails when device is full and discoverable credentials is only preferred.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from authenticator-rs.