You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
Always block sending keys to unverified devices of verified users (#2562)
This commit is contained in:
@@ -1156,10 +1156,16 @@ class MegolmEncryption extends EncryptionAlgorithm {
|
||||
continue;
|
||||
}
|
||||
|
||||
const userTrust = this.crypto.checkUserTrust(userId);
|
||||
const deviceTrust = this.crypto.checkDeviceTrust(userId, deviceId);
|
||||
|
||||
if (userDevices[deviceId].isBlocked() ||
|
||||
(!deviceTrust.isVerified() && isBlacklisting)
|
||||
(!deviceTrust.isVerified() && isBlacklisting) ||
|
||||
// Always withhold keys from unverified devices of verified users
|
||||
(!deviceTrust.isVerified() &&
|
||||
userTrust.isVerified() &&
|
||||
this.crypto.getCryptoTrustCrossSignedDevices()
|
||||
)
|
||||
) {
|
||||
if (!blocked[userId]) {
|
||||
blocked[userId] = {};
|
||||
|
||||
Reference in New Issue
Block a user