Repository navigation
Add a Wi-Fi transport with PIN pairing over QUIC - #3
Merged
Merged
Conversation
Add a QUIC transport (quinn with rustls/ring, TLS 1.3) where both peers use self-signed certificates pinned by SHA-256 fingerprint. Control and video run on separate streams through a split mux, so video loss never delays input or cursor updates. Pairing uses SPAKE2 with a PIN, followed by HMAC key confirmation bound to the TLS exporter and both certificate fingerprints. A pairing window allows 5 attempts within 5 minutes and is guarded by a generation check. A QR URI carries the pairing data. The host limits what unauthenticated peers can do. Protocol minor version is bumped to 0.5. The `quic` feature is off in the workspace dependency so the Windows MSVC cross-check builds without ring. CI gives ring the NDK clang for the Android check.
Add `ezd-host run --wifi [ADDR]` to accept tablets over the QUIC link, and `--pair` to open a pairing window. Pairing shows a QR code and a PIN in the terminal. `ezd-host paired list` and `ezd-host paired forget` manage the paired tablets, which are stored in the config directory. The host advertises itself over mDNS as `_ezdisplay._udp`. Only one session runs at a time across USB and Wi-Fi. Pairing events are reported through the live status. The fake client gains `--wifi`, `--pin`, `--uri` and `--state-dir` for testing the Wi-Fi path. Its strings are added in all six locales. The `wifi` feature is on by default.
The Connection page gets a Wi-Fi card: a switch (which restarts the service, as the listener is read at start), a latency warning, the host address and short fingerprint, a Pair a device button that opens the pairing window and shows the PIN, a QR code and the time left, and the paired devices with Forget. HostService gains paired_devices and forget_paired. The Windows installer opens UDP 27183 on the private profile for ezdisplay.exe and ezd-host.exe and removes the rules on uninstall.
Move pairing, the paired-host store and the connect-with-retry loop into ezd-client-core, keep the fake client as a thin wrapper, and add the startWifi, wifiPair, wifiHosts, wifiForget and wifiIdentity entry points to ezd-android.
Discover hosts with NsdManager, pair by PIN or ezd://pair link, fall back from USB to a paired host, and add a Connection settings section for all layouts, localized in six languages.
A Wi-Fi session now uses one stream per channel: control (bidirectional), input (client), cursor and video (host), so loss on one channel never delays another. Unidirectional streams start with a tag byte and are dispatched by tag. The mux gains per-channel lanes (spawn_mux_lanes, MuxReceiver::new_lanes); a channel without a lane stays on the control stream in priority order. Send priorities: control 4, input 3, cursor 2, audio 1 (reserved), video 0.
Forgetting a device ends its streaming session at once, and a session re-checks the store every 2 s so a forget from another process also ends it. Unvalidated UDP sources get a stateless retry before taking a connection slot. Forget by fingerprint never matches names, and an exact fingerprint wins over a name in the CLI lookup.
…he local network Links now show the host address and the PIN and are refused unless the address is on the local network (checked in Kotlin and in the native pairing). Typed public addresses get a warning. Names lose bidi and format characters. A failing discovered address is skipped for 60 s so a spoofed announcement cannot block the connection.
Add a ufw application profile and a firewalld service for UDP 27183, installed by the Arch package and the .deb (nothing is opened automatically), document the commands, and report the firewall state in diag and in a localized hint when Wi-Fi starts.
When the pinned host refuses with NotPaired, the client removes it from its paired hosts instead of retrying. Android gets a stable failure code next to the English detail, shows the localized reason and keeps it above the USB retry messages until a host is paired again.
# Conflicts: # android/app/src/main/kotlin/com/librestatic/ezdisplay/MainActivity.kt # crates/ezd-android/src/bridge.rs # crates/ezd-host-service/src/config.rs # docs/protocol.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Wi-Fi transport between the Android app and the host. It uses QUIC (quinn + rustls) on UDP 27183, is off by default, and pairs devices with a one-time PIN over SPAKE2. The USB/adb path is unchanged, and the Android app falls back to the paired host over Wi-Fi automatically.
Changes
run --wifior the tray toggle._ezdisplay._udpwith the name and a fingerprint prefix. The address can also be typed by hand.ezd-host run --wifi [--pair]shows the PIN and QR code.ezd-host paired list|forget.ezd-host diagreports afirewallsection, andrun --wifiprints a hint when a firewall is active.Scope notes
docs/windows-testing.md.File::lock.Verification
cargo fmt --check,cargo clippy --workspace --all-targets -D warnings, andcargo test --workspace(646 passed)../gradlew assembleFullDebug assemblePlayDebug lintFullDebug testFullDebugUnitTestall pass.