summaryrefslogtreecommitdiffstats
path: root/net/sctp/auth.c
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2020-05-02 07:31:20 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2020-05-08 07:32:15 +0200
commit75b93c635482dead3071fe60180b12191d3b3b0f (patch)
treeaa4d55d9c94841ec5bb381102ecca865d0812f57 /net/sctp/auth.c
parentBluetooth: use crypto_shash_tfm_digest() (diff)
downloadlinux-75b93c635482dead3071fe60180b12191d3b3b0f.tar.xz
linux-75b93c635482dead3071fe60180b12191d3b3b0f.zip
sctp: 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: linux-sctp@vger.kernel.org Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'net/sctp/auth.c')
-rw-r--r--net/sctp/auth.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c
index 4278764d82b8..83e97e8892e0 100644
--- a/net/sctp/auth.c
+++ b/net/sctp/auth.c
@@ -741,14 +741,8 @@ void sctp_auth_calculate_hmac(const struct sctp_association *asoc,
if (crypto_shash_setkey(tfm, &asoc_key->data[0], asoc_key->len))
goto free;
- {
- SHASH_DESC_ON_STACK(desc, tfm);
-
- desc->tfm = tfm;
- crypto_shash_digest(desc, (u8 *)auth,
- end - (unsigned char *)auth, digest);
- shash_desc_zero(desc);
- }
+ crypto_shash_tfm_digest(tfm, (u8 *)auth, end - (unsigned char *)auth,
+ digest);
free:
if (free_key)