mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-21 18:24:41 +00:00
fixes
This commit is contained in:
parent
e699cb0335
commit
2cf4d51ccb
2 changed files with 7 additions and 7 deletions
|
@ -503,8 +503,10 @@ class BackupService {
|
|||
Future<Uint8List> _exportKeychainDumpV2(String password,
|
||||
{String keychainSalt = secrets.backupKeychainSalt}) async {
|
||||
final key = generateStoreKeyFor(key: SecretStoreKey.pinCodePassword);
|
||||
final encodedPin = await _flutterSecureStorage.read(key: key);
|
||||
final decodedPin = decodedPinCode(pin: encodedPin!);
|
||||
String pin = (await _flutterSecureStorage.read(key: key))!;
|
||||
if (!pin.contains("argon2")) {
|
||||
pin = decodedPinCode(pin: pin);
|
||||
}
|
||||
final wallets = await Future.wait(_walletInfoSource.values.map((walletInfo) async {
|
||||
return {
|
||||
'name': walletInfo.name,
|
||||
|
@ -514,8 +516,8 @@ class BackupService {
|
|||
}));
|
||||
final backupPasswordKey = generateStoreKeyFor(key: SecretStoreKey.backupPassword);
|
||||
final backupPassword = await _flutterSecureStorage.read(key: backupPasswordKey);
|
||||
final data = utf8.encode(
|
||||
json.encode({'pin': decodedPin, 'wallets': wallets, backupPasswordKey: backupPassword}));
|
||||
final data = utf8
|
||||
.encode(json.encode({'pin': pin, 'wallets': wallets, backupPasswordKey: backupPassword}));
|
||||
final encrypted = await _encryptV2(Uint8List.fromList(data), '$keychainSalt$password');
|
||||
|
||||
return encrypted;
|
||||
|
|
|
@ -391,9 +391,7 @@ Future<void> pinEncryptionMigration({required FlutterSecureStorage secureStorage
|
|||
// we don't have a pin?!?
|
||||
if (encodedPin == null) {
|
||||
print("pinEncryptionMigration: no pin found in secure storage!");
|
||||
// this should never happen, but just in case let's just set the pin to "0000"
|
||||
// as it's better than permanently locking the user out with an un-decryptable pin
|
||||
encodedPin = encodedPinCode(pin: "0000");
|
||||
return;
|
||||
}
|
||||
|
||||
// decode & re-encode the pin:
|
||||
|
|
Loading…
Reference in a new issue