mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <l.stach@pengutronix.de>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH] crypto: digest: Fix digesting over memory chunks > 4096 bytes
Date: Mon, 10 Jul 2017 11:03:54 +0200	[thread overview]
Message-ID: <1499677434.2924.7.camel@pengutronix.de> (raw)
In-Reply-To: <20170706180112.32540-1-u.kleine-koenig@pengutronix.de>

Am Donnerstag, den 06.07.2017, 20:01 +0200 schrieb Uwe Kleine-König:
> 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>
> ---
> Hello,
> 
> this is the obvious and minimal patch to fix this issue. Maybe it is
> worth to simplify the function by splitting it in two where each one
> handles one of the cases above.

Yes, making this less confusing to the casual reader of the code seems
like a good idea. I've applied this minimal fix for master.

Regards,
Lucas


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2017-07-10  9:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-06 18:01 Uwe Kleine-König
2017-07-10  9:03 ` Lucas Stach [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499677434.2924.7.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox