Merge branch 'soru/properly-handle-changes-x-signing-key' into 'main'

fix: properly handle changed cross-signing keys

Closes #128

See merge request famedly/famedlysdk!592
This commit is contained in:
Krille Fear 2020-12-29 13:40:22 +00:00
commit af0c402717
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(