Re: [PATCH] ubifs: fix wrong use of crypto_shash_descsize()

Sascha Hauer
2020-05-04T07:16:57Z

On Fri, May 01, 2020 at 10:59:45PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@google.com>
>
> crypto_shash_descsize() returns the size of the shash_desc context
> needed to compute the hash, not the size of the hash itself.
>
> crypto_shash_digestsize() would be correct, or alternatively using
> c->hash_len and c->hmac_desc_len which already store the correct values.
> But actually it's simpler to just use stack arrays, so do that instead.
>
> Fixes: 49525e5eecca ("ubifs: Add helper functions for authentication support")
> Fixes: da8ef65f9573 ("ubifs: Authenticate replayed journal")
> Cc: <stable@vger.kernel.org> # v4.20+
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Signed-off-by: Eric Biggers <ebiggers@google.com>

Looks better that way, thanks.

Acked-by: Sascha Hauer <s.hauer@pengutronix.de>

Sascha

--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |