Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: famedly/matrix-dart-sdk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6b603edc6eb71b984736e8f93357a4e6f5f2e94a
Choose a base ref
..
head repository: famedly/matrix-dart-sdk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: dc411c9b140603bf17942079137f50c0699b0429
Choose a head ref
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/encryption/ssss.dart
6 changes: 4 additions & 2 deletions lib/encryption/ssss.dart
Original file line number Diff line number Diff line change
@@ -328,7 +328,7 @@ class SSSS {
}
final enc = encryptedContent.tryGetMap<String, Object?>(keyId);
if (enc == null) {
throw Exception('Wrong / unknown key');
throw Exception('Wrong / unknown key: $type, $keyId');
}
final ciphertext = enc.tryGet<String>('ciphertext');
final iv = enc.tryGet<String>('iv');
@@ -751,8 +751,10 @@ class OpenSSSS {
throw Exception('SSSS not unlocked');
}
await ssss.store(type, secret, keyId, privateKey, add: add);

while (!ssss.client.accountData.containsKey(type) ||
!(ssss.client.accountData[type]!.content
.tryGetMap<String, Object?>('encrypted')!
.containsKey(keyId)) ||
await getStored(type) != secret) {
Logs().d('Wait for secret of $type to match in accountdata');
await ssss.client.oneShotSync();