]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: algif_hash - Require setkey before accept(2)
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Jan 2016 13:31:04 +0000 (21:31 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Mon, 18 Jan 2016 10:16:11 +0000 (18:16 +0800)
commitf57106e31ee7674a8c46880a83501a3f4a8cd42d
treed896de006eb54d7cafbf16dce5ce8da46462780b
parente3aa32a8d76f136afd9ca53b2759a48bfeb854c0
crypto: algif_hash - Require setkey before accept(2)

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.

Cc: stable@vger.kernel.org
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_hash.c