Split hash_file into three steps, setup, add buf and final.
authorclaudio <claudio@openbsd.org>
Tue, 27 Feb 2024 11:28:30 +0000 (11:28 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 27 Feb 2024 11:28:30 +0000 (11:28 +0000)
commitdcad62ece826198d941fee395371ef36afd22483
tree3b3c1f2f97d321d258597a0fd8be8743ce27fd78
parent17712d2fc01b502e686cb0ed8ba202ddba3da8e9
Split hash_file into three steps, setup, add buf and final.

Setup inits the context and adds the seed. The buf function simply adds
a block from the file to the hash. The final function calls MD4_Final()
to close the context and generate the hash.

This will help to remove the mmap in the sender and should result in a
more atomic view of the file since hash_file() is now called together
with the other hash_functions.

OK deraadt@ tb@
usr.bin/rsync/blocks.c
usr.bin/rsync/extern.h
usr.bin/rsync/hash.c
usr.bin/rsync/sender.c