crypto: digest: Fix digesting over memory chunks > 4096 bytes
There are two different cases that are handled in digest_file_window:

 a) the file to digest is memmappable (e.g. /dev/mem)
 b) it isn't (e.g. files in /)

In both cases a file is digested in hunks of (up to) 4096 bytes. After
each hunk in b) the buffer that is fed to digest_update() is then
overwritten using read() to get the next hunk to digest. In case a)
however it was forgotten to step forward in the buffer and instead the
same data was handed to digest_update() again and again.

So to fix that increase buffer by the number of bytes already digested
for case a) which is characterized by flags == 0.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
1 parent ea1bb56 commit ab909481ee5e9d46325abcdeefee1bd5a705a1da
@Uwe Kleine-König Uwe Kleine-König authored on 6 Jul 2017
Lucas Stach committed on 14 Jul 2017
Showing 1 changed file
View
crypto/digest.c