Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

integrations: Fix BigBlueButton password length.

Felix780bda0d4008
diff --git a/zerver/tests/test_create_video_call.py b/zerver/tests/test_create_video_call.py
index d70f57c6d2e..b92290784dd 100644
--- a/zerver/tests/test_create_video_call.py
+++ b/zerver/tests/test_create_video_call.py
@@ -179,7 +179,7 @@ class TestVideoCall(ZulipTestCase):
def test_create_bigbluebutton_link(self) -> None:
with mock.patch("zerver.views.video_calls.random.randint", return_value="1"), mock.patch(
- "secrets.token_bytes", return_value=b"\x00" * 12
+ "secrets.token_bytes", return_value=b"\x00" * 20
):
response = self.client_get(
"/json/calls/bigbluebutton/create?meeting_name=general > meeting"
@@ -194,7 +194,7 @@ class TestVideoCall(ZulipTestCase):
{
"meeting_id": "zulip-1",
"name": "general > meeting",
- "password": "AAAAAAAAAAAAAAAAAAAA",
+ "password": "A" * 32,
}
),
),
diff --git a/zerver/views/video_calls.py b/zerver/views/video_calls.py
index 508cfcd41df..40b35423dbe 100644
--- a/zerver/views/video_calls.py
+++ b/zerver/views/video_calls.py
@@ -176,7 +176,7 @@ def get_bigbluebutton_url(
# https://docs.bigbluebutton.org/dev/api.html#create for reference on the API calls
# https://docs.bigbluebutton.org/dev/api.html#usage for reference for checksum
id = "zulip-" + str(random.randint(100000000000, 999999999999))
- password = b32encode(secrets.token_bytes(7))[:20].decode()
+ password = b32encode(secrets.token_bytes(20)).decode() # 20 bytes means 32 characters
# We sign our data here to ensure a Zulip user can not tamper with
# the join link to gain access to other meetings that are on the