Fix decrypt_file

Same problem as 58c2ae2, finalizing in a loop.
This commit is contained in:
Zhiming Wang 2020-11-24 17:06:06 +08:00
parent 3d1d75b13b
commit ef9edf7594
No known key found for this signature in database
GPG Key ID: 5B58F95EC95965D8

5
buku
View File

@ -317,9 +317,8 @@ class BukuCrypt:
chunk = infp.read(BukuCrypt.CHUNKSIZE)
if len(chunk) == 0:
break
outfp.write(decryptor.update(chunk) + decryptor.finalize())
outfp.write(decryptor.update(chunk))
outfp.write(decryptor.finalize())
outfp.truncate(size)
# Match hash of generated file with that of original DB file