fix: properly handle changed cross-signing keys
This commit is contained in:
parent
03b9c6e2ee
commit
3ff958de4e
|
|
@ -1508,6 +1508,11 @@ sort order of ${prevState.sortOrder}. This should never happen...''');
|
||||||
if (!oldEntry.value.usage.contains(keyType)) {
|
if (!oldEntry.value.usage.contains(keyType)) {
|
||||||
_userDeviceKeys[userId].crossSigningKeys[oldEntry.key] =
|
_userDeviceKeys[userId].crossSigningKeys[oldEntry.key] =
|
||||||
oldEntry.value;
|
oldEntry.value;
|
||||||
|
} else if (database != null) {
|
||||||
|
// There is a previous cross-signing key with this usage, that we no
|
||||||
|
// longer need/use. Clear it from the database.
|
||||||
|
dbActions.add(() => database.removeUserCrossSigningKey(
|
||||||
|
id, userId, oldEntry.key));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final entry = CrossSigningKey.fromMatrixCrossSigningKey(
|
final entry = CrossSigningKey.fromMatrixCrossSigningKey(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue