Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Make sure that is_verified is a boolean when processing room keys
Browse files Browse the repository at this point in the history
  • Loading branch information
babolivier committed Mar 6, 2020
1 parent 87972f0 commit 80e580a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions synapse/handlers/e2e_room_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,12 @@ def upload_room_keys(self, user_id, version, room_keys):
changed = False # if anything has changed, we need to update the etag
for room_id, room in iteritems(room_keys["rooms"]):
for session_id, room_key in iteritems(room["sessions"]):
if not isinstance(room_key["is_verified"], bool):
msg = (
"is_verified must be a boolean in keys for room %s" % room_id
)
raise SynapseError(400, msg, Codes.INVALID_PARAM)

log_kv(
{
"message": "Trying to upload room key",
Expand Down

1 comment on commit 80e580a

@darix
Copy link

@darix darix commented on 80e580a Mar 28, 2020

Choose a reason for hiding this comment

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

This commit causes a regression. see #7165

Please sign in to comment.