Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: essiv - use crypto_shash_tfm_digest()

Instead of manually allocating a 'struct shash_desc' on the stack and
calling crypto_shash_digest(), switch to using the new helper function
crypto_shash_tfm_digest() which does this for us.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Eric Biggers and committed by
Herbert Xu
1306664f a221b33b

+1 -3
+1 -3
crypto/essiv.c
··· 66 66 const u8 *key, unsigned int keylen) 67 67 { 68 68 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); 69 - SHASH_DESC_ON_STACK(desc, tctx->hash); 70 69 u8 salt[HASH_MAX_DIGESTSIZE]; 71 70 int err; 72 71 ··· 77 78 if (err) 78 79 return err; 79 80 80 - desc->tfm = tctx->hash; 81 - err = crypto_shash_digest(desc, key, keylen, salt); 81 + err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt); 82 82 if (err) 83 83 return err; 84 84