Re: [PATCH 2/2] crypto: algif_hash - Require setkey before accept(2)

From: Milan Broz
Date: Sat Jan 09 2016 - 05:15:48 EST

On 01/08/2016 02:31 PM, Herbert Xu wrote:
> Hash implementations that require a key may crash if you use
> them without setting a key. This patch adds the necessary checks
> so that if you do attempt to use them without a key that we return
> -ENOKEY instead of proceeding.
> This patch also adds a compatibility path to support old applications
> that do acept(2) before setkey.
> Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Reported-and-tested-by: Milan Broz <gmazyland@xxxxxxxxx>

(tested both patches, ditto for previous skcipher series)