This commit is contained in:
David Baker
2020-03-25 18:44:55 +00:00
parent 6ec7b5d404
commit 480b0e64a6
2 changed files with 13 additions and 4 deletions
+9 -3
View File
@@ -471,7 +471,9 @@ export class CrossSigningInfo extends EventEmitter {
if (!userSSK) {
// if the user has no self-signing key then we cannot make any
// trust assertions about this device from cross-signing
return new DeviceTrustLevel(false, false, localTrust, trustCrossSignedDevices);
return new DeviceTrustLevel(
false, false, localTrust, trustCrossSignedDevices,
);
}
const deviceObj = deviceToObject(device, userCrossSigning.userId);
@@ -483,9 +485,13 @@ export class CrossSigningInfo extends EventEmitter {
deviceObj, publicKeyFromKeyInfo(userSSK), userCrossSigning.userId,
);
// ...then we trust this device as much as far as we trust the user
return DeviceTrustLevel.fromUserTrustLevel(userTrust, localTrust, trustCrossSignedDevices);
return DeviceTrustLevel.fromUserTrustLevel(
userTrust, localTrust, trustCrossSignedDevices,
);
} catch (e) {
return new DeviceTrustLevel(false, false, localTrust, trustCrossSignedDevices);
return new DeviceTrustLevel(
false, false, localTrust, trustCrossSignedDevices,
);
}
}
+4 -1
View File
@@ -348,7 +348,10 @@ Crypto.prototype.setCryptoTrustCrossSignedDevices = function(val) {
const devices = this._deviceList.getRawStoredDevicesForUser(userId);
for (const deviceId of Object.keys(devices)) {
const deviceTrust = this.checkDeviceTrust(userId, deviceId);
if (!deviceTrust.isLocallyVerified() && deviceTrust.isCrossSigningVerified()) {
if (
!deviceTrust.isLocallyVerified() &&
deviceTrust.isCrossSigningVerified()
) {
const deviceObj = this._deviceList.getStoredDevice(userId, deviceId);
this.emit("deviceVerificationChanged", userId, deviceId, deviceObj);
}