Skip to content

Commit b51b42a

Browse files
committed
Merge remote-tracking branch 'origin/linux' into linux
2 parents ad5dc4e + dc1925d commit b51b42a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

lib/model/crypto.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,17 @@ class StoredCryptoStore extends AsyncNotifier<CryptoStore?> {
2424
@override
2525
FutureOr<CryptoStore?> build() async {
2626
Salt? salt = await Salt.readFromLocalStorage();
27-
if (salt == null || !await SimpleSecureStorage.has(_kPasswordDerivedKeyKey)) {
27+
if (salt == null) {
2828
return null;
2929
}
30+
31+
String? derivedKey = await SimpleSecureStorage.read(_kPasswordDerivedKeyKey);
32+
if (derivedKey == null) {
33+
return null;
34+
}
35+
3036
return CryptoStore._(
31-
key: await AesGcmSecretKey.importRawKey(base64.decode((await SimpleSecureStorage.read(_kPasswordDerivedKeyKey))!)),
37+
key: await AesGcmSecretKey.importRawKey(base64.decode(derivedKey)),
3238
salt: salt,
3339
);
3440
}

0 commit comments

Comments
 (0)