-
Notifications
You must be signed in to change notification settings - Fork 19
Hybrid transport: Add state-assisted transactions #100
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
Conversation
msirringhaus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only small comments so far
|
Connecting to a known device is now working on Android. I'll add handshake signature verification next, as part of this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for state-assisted caBLE transactions by refactoring the tunnel API, making device storage thread-safe, and parsing/verifying update messages.
- Introduce
CableTunnelConnectionType, separate handshake (do_handshake) from channel setup (channel), and addconnection_recv_updateparsing with HMAC verification. - Make
CableKnownDeviceInfoStorethread-safe (usingArc<Mutex<_>>), defineCableKnownDeviceInfoandCableKnownDeviceflows, and update examples to use a persistent store. - Factor out BLE advertisement handling into
advertisement.rsand update QR code device logic to consume it.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| libwebauthn/src/transport/error.rs | Added UnknownDevice, InvalidKey, and InvalidSignature error variants |
| libwebauthn/src/transport/cable/tunnel.rs | Refactored tunnel connection, added state-assisted flow, parsing of update messages |
| libwebauthn/src/transport/cable/qr_code_device.rs | Switched to Arc store, removed embedded BLE logic, now uses advertisement module |
| libwebauthn/src/transport/cable/known_devices.rs | Thread-safe store implementation, new CableKnownDeviceInfo and CableKnownDevice types |
| libwebauthn/src/transport/cable/advertisement.rs | New BLE advertisement module, extracts and decrypts service data |
| libwebauthn/src/transport/cable/crypto.rs | Changed derive to return a fixed-size [u8; 64] instead of Vec<u8> |
| libwebauthn/src/transport/cable/channel.rs | Simplified CableChannel, removed device enum, added Drop impl to abort tasks |
| libwebauthn/src/transport/ble/btleplug/manager.rs | Updated discovery API to include Adapter in stream items |
| libwebauthn/src/transport/cable/mod.rs | Exposed the new advertisement submodule |
| libwebauthn/examples/webauthn_cable.rs | Example updated to demonstrate persistent known-device flow over QR and state-assisted paths |
Comments suppressed due to low confidence (2)
libwebauthn/src/transport/ble/btleplug/manager.rs:84
- The return type trait bound '+ use<'>' is invalid syntax; it should likely be '+ '', or a correct lifetime specifier.
)-> Result<impl Stream<Item = (Adapter, Peripheral, Vec<u8>)> + use<'_>, Error> {
libwebauthn/src/transport/cable/tunnel.rs:590
- The new function
connection_recv_updatecontains non-trivial parsing logic for CAble update messages but lacks corresponding unit tests. Consider adding tests that cover valid, missing-field, and error cases.
async fn connection_recv_update(message: &[u8]) -> Result<Option<CableLinkingInfo>, Error> {
msirringhaus
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nitpicks. I currently can't judge the overall spec compliance, but I think you know what you are doing :)
821e2aa to
3cff871
Compare
Changes
serde_cbor. To be fixed properly with Ignore unknown CTAP response fields #66.