Read first frame of backup to validate before proceeding.

Addresses #11952.
This commit is contained in:
Nicholas
2023-10-02 20:30:39 -04:00
committed by GitHub
parent e9fbce4e28
commit da84cde6da
3 changed files with 81 additions and 18 deletions

View File

@@ -289,6 +289,11 @@ public final class RestoreBackupFragment extends LoggingFragment {
SQLiteDatabase database = SignalDatabase.getBackupDatabase();
BackupPassphrase.set(context, passphrase);
if (!FullBackupImporter.validatePassphrase(context, backup.getUri(), passphrase)) {
return BackupImportResult.FAILURE_UNKNOWN;
}
FullBackupImporter.importFile(context,
AttachmentSecretProvider.getInstance(context).getOrCreateAttachmentSecret(),
database,