Herbert Xu a8348bca29 crypto: algif_hash - Fix NULL hash crash with shash
Recently algif_hash has been changed to allow null hashes.  This
triggers a bug when used with an shash algorithm whereby it will
cause a crash during the digest operation.

This patch fixes it by avoiding the digest operation and instead
doing an init followed by a final which avoids the buggy code in
shash.

This patch also ensures that the result buffer is freed after an
error so that it is not returned as a genuine hash result on the
next recv call.

The shash/ahash wrapper code will be fixed later to handle this
case correctly.

Fixes: 493b2ed3f760 ("crypto: algif_hash - Handle NULL hashes correctly")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Tested-by: Laura Abbott <labbott@redhat.com>
2016-11-18 22:34:10 +08:00
..
2016-07-01 23:45:11 +08:00
2016-07-18 17:35:38 +08:00
2016-07-18 17:35:39 +08:00
2016-07-18 17:35:40 +08:00
2016-07-18 17:35:39 +08:00
2016-07-18 17:35:44 +08:00
2016-08-24 21:04:49 +08:00
2016-08-16 17:16:49 +08:00