fix: properly handle changed cross-signing keys

This commit is contained in:
Sorunome 2020-12-29 14:37:09 +01:00
parent 03b9c6e2ee
commit 3ff958de4e
No known key found for this signature in database
GPG Key ID: B19471D07FC9BE9C
1 changed files with 5 additions and 0 deletions

View File

@ -1508,6 +1508,11 @@ sort order of ${prevState.sortOrder}. This should never happen...''');
if (!oldEntry.value.usage.contains(keyType)) {
_userDeviceKeys[userId].crossSigningKeys[oldEntry.key] =
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(