Ignore key requests from unknown devices

This commit is contained in:
Christian Pauly 2020-05-25 07:31:17 +00:00
parent b78315872f
commit f7b29f3703
2 changed files with 2 additions and 2 deletions

View file

@ -1574,7 +1574,7 @@ class Client {
deviceKeys.verified && deviceKeys.verified &&
!deviceKeys.blocked) { !deviceKeys.blocked) {
await roomKeyRequest.forwardKey(); await roomKeyRequest.forwardKey();
} else { } else if (roomKeyRequest.requestingDevice != null) {
onRoomKeyRequest.add(roomKeyRequest); onRoomKeyRequest.add(roomKeyRequest);
} }
} }

View file

@ -22,7 +22,7 @@ class RoomKeyRequest extends ToDeviceEvent {
for (final key in session.forwardingCurve25519KeyChain) { for (final key in session.forwardingCurve25519KeyChain) {
forwardedKeys.add(key); forwardedKeys.add(key);
} }
await requestingDevice?.setVerified(true, client); await requestingDevice.setVerified(true, client);
var message = session.content; var message = session.content;
message['forwarding_curve25519_key_chain'] = forwardedKeys; message['forwarding_curve25519_key_chain'] = forwardedKeys;