Reject key requests for users that are not members of the room

This commit is contained in:
Konstantinos Sideris 2018-07-21 21:40:11 +03:00
parent a823a43686
commit 5dfd26abc5
3 changed files with 24 additions and 0 deletions

View file

@ -369,6 +369,14 @@ handle_key_request_message(const mtx::events::msg::KeyRequest &req)
return;
}
if (!cache::client()->isRoomMember(req.sender, req.room_id)) {
nhlog::crypto()->warn(
"user {} that requested the session key is not member of the room {}",
req.sender,
req.room_id);
return;
}
//
// Prepare the m.room_key event.
//