backup: do not fail restore if scrypt anticipate more time needed

For various reasons, decryption may be slower than initial encryption
(different hardware, different system load etc). Do not fail the restore
operation if scrypt anticipate it will take considerably more time or
memory, than while creating the backup (where the scrypt parameters were
originally set).

Thanks to @jharveyb for the report and suggested solution.
Fixes QubesOS/qubes-issues#4683
This commit is contained in:
Marek Marczykowski-Górecki 2019-01-09 19:09:44 +01:00
parent 61cc6b008e
commit 89ee4931fb
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -227,7 +227,7 @@ def launch_scrypt(action, input_name, output_name, passphrase):
:param passphrase: passphrase
:return: subprocess.Popen object
'''
command_line = ['scrypt', action, input_name, output_name]
command_line = ['scrypt', action, '-f', input_name, output_name]
(p, pty) = launch_proc_with_pty(command_line,
stdin=subprocess.PIPE if input_name == '-' else None,
stdout=subprocess.PIPE if output_name == '-' else None,