Skip to content
Snippets Groups Projects
Unverified Commit 80e580ae authored by Brendan Abolivier's avatar Brendan Abolivier
Browse files

Make sure that is_verified is a boolean when processing room keys

parent 87972f07
Branches
Tags
No related merge requests found
...@@ -207,6 +207,12 @@ class E2eRoomKeysHandler(object): ...@@ -207,6 +207,12 @@ class E2eRoomKeysHandler(object):
changed = False # if anything has changed, we need to update the etag changed = False # if anything has changed, we need to update the etag
for room_id, room in iteritems(room_keys["rooms"]): for room_id, room in iteritems(room_keys["rooms"]):
for session_id, room_key in iteritems(room["sessions"]): 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( log_kv(
{ {
"message": "Trying to upload room key", "message": "Trying to upload room key",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment