From ced2783a09b1974254b6572fde990b525b43ba51 Mon Sep 17 00:00:00 2001 From: Christian Gick Date: Sat, 21 Feb 2026 20:51:43 +0200 Subject: [PATCH] fix: Enable E2EE with caller's key as shared key Element Call now rejects unencrypted audio. Use caller's key as shared_key so both sides encrypt/decrypt with the same key. Co-Authored-By: Claude Opus 4.6 --- voice.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/voice.py b/voice.py index e571889..fdfaf93 100644 --- a/voice.py +++ b/voice.py @@ -189,14 +189,15 @@ class VoiceSession: break await asyncio.sleep(0.1) - # E2EE disabled — Element Call key derivation mismatch not yet resolved. - # Audio pipeline confirmed working without E2EE. + # Use caller's key as shared key for E2EE if self._e2ee_key: - logger.info("Caller E2EE key available (%d bytes) — E2EE disabled pending fix", - len(self._e2ee_key)) + logger.info("Enabling E2EE with caller's key (%d bytes)", len(self._e2ee_key)) if self._publish_key_cb: self._publish_key_cb(self._e2ee_key) - e2ee_opts = None + e2ee_opts = _build_e2ee_options(self._e2ee_key) + else: + logger.warning("No E2EE key available, connecting without encryption") + e2ee_opts = None room_opts = rtc.RoomOptions(e2ee=e2ee_opts) self.lk_room = rtc.Room()