diff options
author | Eric Biggers <ebiggers@google.com> | 2020-05-02 07:31:06 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2020-05-08 07:32:13 +0200 |
commit | 7e3e48d86b7c96f12896dd7111e4e5ae51c1b7da (patch) | |
tree | 11684cfd9ea999b6656192561ef3f576b54ac355 /drivers/crypto/axis/artpec6_crypto.c | |
parent | crypto: essiv - use crypto_shash_tfm_digest() (diff) | |
download | linux-7e3e48d86b7c96f12896dd7111e4e5ae51c1b7da.tar.xz linux-7e3e48d86b7c96f12896dd7111e4e5ae51c1b7da.zip |
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>
Diffstat (limited to 'drivers/crypto/axis/artpec6_crypto.c')
-rw-r--r-- | drivers/crypto/axis/artpec6_crypto.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c index fcf1effc7661..62ba0325a618 100644 --- a/drivers/crypto/axis/artpec6_crypto.c +++ b/drivers/crypto/axis/artpec6_crypto.c @@ -2239,16 +2239,12 @@ artpec6_crypto_hash_set_key(struct crypto_ahash *tfm, blocksize = crypto_tfm_alg_blocksize(crypto_ahash_tfm(tfm)); if (keylen > blocksize) { - SHASH_DESC_ON_STACK(hdesc, tfm_ctx->child_hash); - - hdesc->tfm = tfm_ctx->child_hash; - tfm_ctx->hmac_key_length = blocksize; - ret = crypto_shash_digest(hdesc, key, keylen, - tfm_ctx->hmac_key); + + ret = crypto_shash_tfm_digest(tfm_ctx->child_hash, key, keylen, + tfm_ctx->hmac_key); if (ret) return ret; - } else { memcpy(tfm_ctx->hmac_key, key, keylen); tfm_ctx->hmac_key_length = keylen; |