Voice 23: Voice E2EE (shared key), off by default #84

Closed
opened 2026-11-11 12:17:45 +00:00 by charles · 2 comments
Owner

Files:

  • Modify: crates/fluxer-voice/src/rtc.rs, crates/fluxer-voice/tests/livekit_interop.rs, fluxer-core (voice::settings flag experimental_e2ee, identify property, E2eeRequired message), settings UI (advanced/experimental toggle)
  • Test: interop + crates/fluxer-core/tests/voice_e2ee.rs

Interfaces:

  • Produces: RoomOptions.e2ee_key honoured with the parameters of spec §8; VoiceEvent::E2eeState; e2ee_capable in IDENTIFY follows the setting (reconnects the gateway when toggled); with the setting off an e2ee_key in VOICE_SERVER_UPDATE is ignored; VOICE_E2EE_REQUIRED shows "This channel requires end-to-end encryption, which is experimental in this client. Enable it in Advanced settings."

  • Tests: two_sessions_with_same_key_hear_tone, wrong_key_hears_nothing_and_reports_e2ee_state, identify_capability_follows_setting, e2ee_required_error_message.

  • Commit feat(voice): shared-key E2EE behind an experimental setting.

Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md
Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md

**Files:** - Modify: `crates/fluxer-voice/src/rtc.rs`, `crates/fluxer-voice/tests/livekit_interop.rs`, `fluxer-core` (`voice::settings` flag `experimental_e2ee`, identify property, `E2eeRequired` message), settings UI (advanced/experimental toggle) - Test: interop + `crates/fluxer-core/tests/voice_e2ee.rs` **Interfaces:** - Produces: `RoomOptions.e2ee_key` honoured with the parameters of spec §8; `VoiceEvent::E2eeState`; `e2ee_capable` in IDENTIFY follows the setting (reconnects the gateway when toggled); with the setting off an `e2ee_key` in `VOICE_SERVER_UPDATE` is ignored; `VOICE_E2EE_REQUIRED` shows "This channel requires end-to-end encryption, which is experimental in this client. Enable it in Advanced settings." - [ ] Tests: `two_sessions_with_same_key_hear_tone`, `wrong_key_hears_nothing_and_reports_e2ee_state`, `identify_capability_follows_setting`, `e2ee_required_error_message`. - [ ] Commit `feat(voice): shared-key E2EE behind an experimental setting`. Plan: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/plans/2026-11-11-voice.md Spec: https://git.forked.io/charles/fluxer-native/src/branch/main/docs/superpowers/specs/2026-11-11-fluxer-native-voice-design.md
charles added this to the Voice milestone 2026-11-11 12:17:45 +00:00
Author
Owner

Independent review: Voice 23 (E2EE, shared key), branch voice-23-voice-e2ee @ 9844393

Where this comment is: the implementer's notes say this is PR #145, but #145 is Voice 21: Settings → Voice & Video (voice-21-ui-voice-settings). No PR exists for voice-23-voice-e2ee, open or closed, so I am posting the review on the task issue instead. Someone needs to open the PR (stacked on #121, targeting voice, with Closes #84).

Scope: git diff 5550287..origin/voice-23-voice-e2ee, which is 21 files.

Checks

  1. Plan tests: all four exist and assert what the plan says.
    • two_sessions_with_same_key_hear_tone: the tone arrives and E2eeState{ok:true} is reported.
    • wrong_key_hears_nothing_and_reports_e2ee_state: no tone in 5 s, then E2eeState{ok:false}.
    • identify_capability_follows_setting: off by default, toggling sends a new ConnectGateway with the same URL and token, a no-op toggle sends nothing, and the next login after a logout is capable.
    • e2ee_required_error_message: checks the exact spec string and that VoiceFailure::E2eeRequired.message() returns it.
    • Extra tests: a_session_without_the_key_hears_no_tone and data_is_readable_without_the_key_in_an_encrypted_room, plus DecryptWatch unit tests and a key-parameter unit test.
  2. Interfaces:
    • RoomOptions.e2ee_key is honoured.
    • VoiceEvent::E2eeState is emitted.
    • e2ee_capable reaches IDENTIFY through Effect::ConnectGateway { url, token, e2ee_capable } → client_properties(e2ee_capable).
    • With the setting off, the key is dropped before VoiceCommand::Connect.
    • VOICE_E2EE_REQUIRED shows the plan's exact text.
    • Adding a field to Effect::ConnectGateway breaks exhaustive patterns. Every user in the workspace was updated and builds.
  3. Spec §8 parameters (checked against the SDK sources, livekit 0.10.1 / libwebrtc 0.4.0):
    • Key: the string's UTF-8 bytes. with_shared_key forces shared_key: true and sets key index 0.
    • Salt LKFrameEncryptionKey, ratchet window 0, failure tolerance -1 (matches facts §2), PBKDF2, AES-GCM.
    • The PBKDF2 iteration count (100000) and hash (SHA-256) are inside the prebuilt libwebrtc and cannot be asserted from Rust. They are only proven native-to-native, which the spec accepts (§12 Q1).
  4. Invariants:
    • fluxer-core gains no forbidden dependency.
    • fluxer-ui has no I/O.
    • gateway_login() handles a bad URL with .ok()?, so server data cannot panic it.
    • No secrets: fixture keys are dummies. e2ee_options has a test that its Debug output does not show the key. Review Focus 7 (record_mode_never_contains_token_or_e2ee_key) still passes.
  5. Review Focus: none is specific to Voice 23. #4 (path prefix) is still covered by the interop suite through the proxy.
  6. CI: FLUXER_SCREENSHOT_TESTS=1 FLUXER_LIVEKIT_TESTS=1 cargo xtask ci in a fresh worktree: all steps passed. All interop tests ran, including the four E2EE ones, against a local livekit-server.

Findings

  • minor (process): no PR exists for this branch, and the "PR 145" in the hand-off is a different task's PR. Open one before this can be labelled ready-to-merge.
  • minor: crates/fluxer-core/src/app.rs:248. The new impl App { fn sync_e2ee_capability } block was inserted between open_url's doc comment ("Links come from message content…") and fn open_url. That comment now documents the impl block, and open_url has none.
  • minor (behaviour, untested): toggling the setting during a call replaces the gateway session. On READY the core re-sends op 4 for the current call. However, an already-joined room keeps the key it joined with (or none), and the server may answer the new non-capable session with VOICE_E2EE_REQUIRED. The UI text warns "Changing this reconnects to the server". Consider disabling the switch while in voice, or a follow-up test.
  • minor: decrypts() treats EncryptionState::New as ok. If the SDK ever reports New for a remote cryptor, DecryptWatch stops watching that participant and a wrong key would never be reported. The wrong-key interop test passes today against 1.12.0, so this is only a fragility note.

Verdict: APPROVED. No blocking findings and local CI is green. A PR still has to be opened for the branch.

## Independent review: Voice 23 (E2EE, shared key), branch `voice-23-voice-e2ee` @ 9844393 **Where this comment is:** the implementer's notes say this is PR #145, but #145 is *Voice 21: Settings → Voice & Video* (`voice-21-ui-voice-settings`). No PR exists for `voice-23-voice-e2ee`, open or closed, so I am posting the review on the task issue instead. Someone needs to open the PR (stacked on #121, targeting `voice`, with `Closes #84`). Scope: `git diff 5550287..origin/voice-23-voice-e2ee`, which is 21 files. ### Checks 1. **Plan tests:** all four exist and assert what the plan says. - `two_sessions_with_same_key_hear_tone`: the tone arrives and `E2eeState{ok:true}` is reported. - `wrong_key_hears_nothing_and_reports_e2ee_state`: no tone in 5 s, then `E2eeState{ok:false}`. - `identify_capability_follows_setting`: off by default, toggling sends a new `ConnectGateway` with the same URL and token, a no-op toggle sends nothing, and the next login after a logout is capable. - `e2ee_required_error_message`: checks the exact spec string and that `VoiceFailure::E2eeRequired.message()` returns it. - Extra tests: `a_session_without_the_key_hears_no_tone` and `data_is_readable_without_the_key_in_an_encrypted_room`, plus DecryptWatch unit tests and a key-parameter unit test. 2. **Interfaces:** - `RoomOptions.e2ee_key` is honoured. - `VoiceEvent::E2eeState` is emitted. - `e2ee_capable` reaches IDENTIFY through `Effect::ConnectGateway { url, token, e2ee_capable }` → `client_properties(e2ee_capable)`. - With the setting off, the key is dropped before `VoiceCommand::Connect`. - `VOICE_E2EE_REQUIRED` shows the plan's exact text. - Adding a field to `Effect::ConnectGateway` breaks exhaustive patterns. Every user in the workspace was updated and builds. 3. **Spec §8 parameters (checked against the SDK sources, livekit 0.10.1 / libwebrtc 0.4.0):** - Key: the string's UTF-8 bytes. `with_shared_key` forces `shared_key: true` and sets key index 0. - Salt `LKFrameEncryptionKey`, ratchet window 0, failure tolerance -1 (matches facts §2), PBKDF2, AES-GCM. - The PBKDF2 iteration count (100000) and hash (SHA-256) are inside the prebuilt libwebrtc and cannot be asserted from Rust. They are only proven native-to-native, which the spec accepts (§12 Q1). 4. **Invariants:** - `fluxer-core` gains no forbidden dependency. - `fluxer-ui` has no I/O. - `gateway_login()` handles a bad URL with `.ok()?`, so server data cannot panic it. - No secrets: fixture keys are dummies. `e2ee_options` has a test that its Debug output does not show the key. Review Focus 7 (`record_mode_never_contains_token_or_e2ee_key`) still passes. 5. **Review Focus:** none is specific to Voice 23. #4 (path prefix) is still covered by the interop suite through the proxy. 6. **CI:** `FLUXER_SCREENSHOT_TESTS=1 FLUXER_LIVEKIT_TESTS=1 cargo xtask ci` in a fresh worktree: **all steps passed**. All interop tests ran, including the four E2EE ones, against a local livekit-server. ### Findings - **minor (process):** no PR exists for this branch, and the "PR 145" in the hand-off is a different task's PR. Open one before this can be labelled `ready-to-merge`. - **minor:** `crates/fluxer-core/src/app.rs:248`. The new `impl App { fn sync_e2ee_capability }` block was inserted between `open_url`'s doc comment ("Links come from message content…") and `fn open_url`. That comment now documents the impl block, and `open_url` has none. - **minor (behaviour, untested):** toggling the setting during a call replaces the gateway session. On READY the core re-sends op 4 for the current call. However, an already-joined room keeps the key it joined with (or none), and the server may answer the new non-capable session with `VOICE_E2EE_REQUIRED`. The UI text warns "Changing this reconnects to the server". Consider disabling the switch while in voice, or a follow-up test. - **minor:** `decrypts()` treats `EncryptionState::New` as ok. If the SDK ever reports `New` for a remote cryptor, DecryptWatch stops watching that participant and a wrong key would never be reported. The wrong-key interop test passes today against 1.12.0, so this is only a fragility note. **Verdict: APPROVED.** No blocking findings and local CI is green. A PR still has to be opened for the branch.
Author
Owner

Merged into voice in 53e3d60 (the PR for this task, #145, was opened with the wrong head branch name; the work is on voice-23-voice-e2ee, which the merge contains).

Merged into `voice` in 53e3d60 (the PR for this task, #145, was opened with the wrong head branch name; the work is on `voice-23-voice-e2ee`, which the merge contains).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#84
No description provided.