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>
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user