[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZFN8a0z6qQUW6Zbg@gondor.apana.org.au>
Date: Thu, 4 May 2023 17:35:39 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: David Yang <mmyangfl@...il.com>
Cc: linux-crypto@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] crypto: hash - Add default handlers for digest, export,
import
On Thu, May 04, 2023 at 05:32:55PM +0800, David Yang wrote:
> The document of struct ahash_alg explicitly states that @finup,
> combination of @update and @final, is optional, while said nothing about
> @digest, which is combination of @init and @finup (@update and @final).
>
> This gives a illusion that @digest might be optional. However
> crypto_ahash_init_tfm() strangely does expect a non-NULL @digest,
> otherwise it'll result in NULL pointer dereference.
>
> Add default handlers for digest, export, import according to the behavior
> in the document, and mark them optional.
>
> Signed-off-by: David Yang <mmyangfl@...il.com>
> ---
> crypto/ahash.c | 28 +++++++++++++++++++++++++---
> include/crypto/hash.h | 12 ++++++------
> 2 files changed, 31 insertions(+), 9 deletions(-)
Nack. There is a default for finup because finup was added later.
Every driver should implement all of the methods.
Cheers,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists