fix(e2ee): use correct Element Call E2EE parameters
Inline E2EE options had 3 wrong values vs Element Call JS SDK: - failure_tolerance=-1 (infinite, hid all DEC_FAILED) → 10 - key_ring_size=16 (too small, keys overflow) → 256 - ratchet_window_size=16 (wrong) → 10 Now uses _build_e2ee_options() which was already correct but never called. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
20
voice.py
20
voice.py
@@ -261,7 +261,10 @@ def _build_e2ee_options() -> rtc.E2EEOptions:
|
||||
key_ring_size=256,
|
||||
key_derivation_function=KDF_HKDF, # Rust FFI applies HKDF; we pass raw base keys
|
||||
)
|
||||
return rtc.E2EEOptions(key_provider_options=key_opts)
|
||||
return rtc.E2EEOptions(
|
||||
encryption_type=rtc.EncryptionType.GCM,
|
||||
key_provider_options=key_opts,
|
||||
)
|
||||
|
||||
|
||||
class VoiceSession:
|
||||
@@ -421,18 +424,9 @@ class VoiceSession:
|
||||
# E2EE: re-enabled after diagnostic confirmed EC encrypts audio.
|
||||
# Root cause found: set_key() only applies HKDF if the frame cryptor for that
|
||||
# participant already exists. Must call set_key() in on_track_subscribed, not at connect time.
|
||||
key_opts = rtc.KeyProviderOptions(
|
||||
shared_key=b"", # per-participant mode
|
||||
ratchet_window_size=16,
|
||||
ratchet_salt=b"LKFrameEncryptionKey",
|
||||
failure_tolerance=-1,
|
||||
key_ring_size=16,
|
||||
key_derivation_function=KDF_HKDF, # Rust applies HKDF matching EC JS SDK
|
||||
)
|
||||
e2ee_opts = rtc.E2EEOptions(
|
||||
encryption_type=rtc.EncryptionType.GCM,
|
||||
key_provider_options=key_opts,
|
||||
)
|
||||
# Parameters MUST match Element Call JS SDK: ratchetWindowSize=10, keyringSize=256,
|
||||
# failureTolerance=10, ratchetSalt="LKFrameEncryptionKey".
|
||||
e2ee_opts = _build_e2ee_options()
|
||||
room_opts = rtc.RoomOptions(e2ee=e2ee_opts)
|
||||
self.lk_room = rtc.Room()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user