Skip to content

Fix E2EE connection failure caused by missing required protobuf fields key_ring_size and key_derivation_function in KeyProviderOptions.#628

Merged
xianshijing-lk merged 3 commits intomainfrom
sxian/fix_e2ee_problem
Apr 15, 2026
Merged

Fix E2EE connection failure caused by missing required protobuf fields key_ring_size and key_derivation_function in KeyProviderOptions.#628
xianshijing-lk merged 3 commits intomainfrom
sxian/fix_e2ee_problem

Conversation

@xianshijing-lk
Copy link
Copy Markdown
Contributor

Problem:
When connecting with E2EE enabled via E2EEOptions(key_provider_options=KeyProviderOptions(shared_key=...)), the connect call fails with a protobuf EncodeError.

This regression was introduced by livekit/rust-sdks#921 which added two new required fields to the KeyProviderOptions proto message:

  • required int32 key_ring_size = 5
  • required KeyDerivationFunction key_derivation_function = 6

The Python SDK's KeyProviderOptions dataclass and room.py connect method were not updated to populate these fields.
Changes

  • e2ee.py: Added key_ring_size (default: 16) and key_derivation_function (default: PBKDF2) fields to KeyProviderOptions dataclass
  • room.py: Set these fields in FFI request for both options.e2ee and options.encryption code paths
  • init.py: Export KeyDerivationFunction enum for user customization
  • tests/test_e2ee.py: Added unit tests for E2EE dataclasses and proto serialization
    Test Plan
    Unit Tests
    cd livekit-rtc
    pip install pytest
    python -m pytest tests/test_e2ee.py -v

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@xianshijing-lk xianshijing-lk merged commit 1dfb135 into main Apr 15, 2026
29 checks passed
@xianshijing-lk xianshijing-lk deleted the sxian/fix_e2ee_problem branch April 15, 2026 18:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants