Compare commits
2 Commits
5973ed1db3
...
4ab5486b5c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ab5486b5c | ||
|
|
c4581c2917 |
14
voice.py
14
voice.py
@@ -263,7 +263,7 @@ class VoiceSession:
|
||||
# NOTE: HTTP fetch is useless here — keys are Matrix-E2EE encrypted (m.room.encrypted).
|
||||
pre_max_idx = max(self._caller_all_keys.keys()) if self._caller_all_keys else -1
|
||||
logger.info("Waiting for EC key rotation via nio sync (current max_idx=%d)...", pre_max_idx)
|
||||
for _attempt in range(20): # up to 10s (20 × 0.5s)
|
||||
for _attempt in range(4): # up to 2s (4 × 0.5s)
|
||||
await asyncio.sleep(0.5)
|
||||
new_max = max(self._caller_all_keys.keys()) if self._caller_all_keys else -1
|
||||
if new_max > pre_max_idx:
|
||||
@@ -271,10 +271,10 @@ class VoiceSession:
|
||||
logger.info("Key rotated: index %d→%d (%d bytes)",
|
||||
pre_max_idx, new_max, len(self._caller_key))
|
||||
break
|
||||
if _attempt % 4 == 3: # log every 2s
|
||||
logger.info("Key rotation wait %ds: max_idx still %d", (_attempt + 1) // 2, new_max)
|
||||
if _attempt % 2 == 1: # log every 1s
|
||||
logger.info("Key rotation wait %0.1fs: max_idx still %d", (_attempt + 1) * 0.5, new_max)
|
||||
else:
|
||||
logger.warning("No key rotation after 10s — using pre-join key[%d]", pre_max_idx)
|
||||
logger.warning("No key rotation after 2s — using pre-join key[%d]", pre_max_idx)
|
||||
|
||||
# Set per-participant keys via key provider — pass raw base keys.
|
||||
# KDF_HKDF=1: Rust FFI applies HKDF(base_key, ratchetSalt, ...) internally.
|
||||
@@ -367,7 +367,7 @@ class VoiceSession:
|
||||
while True:
|
||||
await asyncio.sleep(5)
|
||||
_poll_count += 1
|
||||
if _poll_count % 6 == 0: # Every 30s
|
||||
if _poll_count % 2 == 0: # Every 10s
|
||||
try:
|
||||
cryptors = self.lk_room.e2ee_manager.frame_cryptors()
|
||||
for c in cryptors:
|
||||
@@ -375,6 +375,10 @@ class VoiceSession:
|
||||
c.participant_identity, c.key_index, c.enabled)
|
||||
except Exception as e:
|
||||
logger.debug("frame_cryptors() failed: %s", e)
|
||||
# Log E2EE state for all remote participants
|
||||
for p in self.lk_room.remote_participants.values():
|
||||
logger.info("REMOTE_PARTICIPANT: identity=%s tracks=%d",
|
||||
p.identity, len(p.track_publications))
|
||||
|
||||
except asyncio.CancelledError:
|
||||
logger.info("Session cancelled for %s", self.room_id)
|
||||
|
||||
Reference in New Issue
Block a user