Open newer account backups in the account flow
This commit is contained in:
1 parent
bac4a1d519
commit
0d0438f912
1 file changed
+6
-3
@@ -16,6 +16,7 @@
|
||||
#import, file "../storage/daochi_account.zi";
|
||||
#import, file "../storage/device_key.zi";
|
||||
#import "keys"
|
||||
Recovery :: #import "entity/recovery";
|
||||
#import, file "../storage/sync_async.zi";
|
||||
#import, file "../storage/sync_state.zi";
|
||||
#import, file "../storage/storage_layout.zi";
|
||||
@@ -804,9 +805,11 @@ TelegramAccountFlowPump :: (app: *InnerBreeze) {
|
||||
TelegramAccountClearPassword(*flow.recovery_input)
|
||||
return
|
||||
}
|
||||
candidate: AccountKeys
|
||||
valid := ParseEncryptedAccountKeys(TextUntilNul(flow.recovery[:]),
|
||||
TextUntilNul(flow.recovery_input.value[:]), *candidate) != 0
|
||||
restored: Recovery.Recovery
|
||||
valid := Recovery.RecoveryNeedsPassword(TextUntilNul(flow.recovery[:])) &&
|
||||
Recovery.RecoveryDecode(TextUntilNul(flow.recovery[:]), TextUntilNul(flow.recovery_input.value[:]), *restored)
|
||||
candidate := restored.keys
|
||||
Recovery.RecoveryClear(*restored)
|
||||
TelegramAccountClearPassword(*flow.recovery_input)
|
||||
SecureWipe(*flow.recovery[0], 17664)
|
||||
owner := AccountFieldText(*candidate.public_id[0], ACCOUNT_PUBLIC_ID_HEX_SIZE)
|
||||
|
||||
Reference in new issue
Block a user