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

crypto: artpec6 - 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.

Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Lars Persson <lars.persson@axis.com>
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
7e3e48d8 1306664f

+3 -7
+3 -7
drivers/crypto/axis/artpec6_crypto.c
··· 2239 2239 blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); 2240 2240 2241 2241 if (keylen > blocksize) { 2242 - SHASH_DESC_ON_STACK(hdesc, tfm_ctx->child_hash); 2243 - 2244 - hdesc->tfm = tfm_ctx->child_hash; 2245 - 2246 2242 tfm_ctx->hmac_key_length = blocksize; 2247 - ret = crypto_shash_digest(hdesc, key, keylen, 2248 - tfm_ctx->hmac_key); 2243 + 2244 + ret = crypto_shash_tfm_digest(tfm_ctx->child_hash, key, keylen, 2245 + tfm_ctx->hmac_key); 2249 2246 if (ret) 2250 2247 return ret; 2251 - 2252 2248 } else { 2253 2249 memcpy(tfm_ctx->hmac_key, key, keylen); 2254 2250 tfm_ctx->hmac_key_length = keylen;