]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
thunderbolt: Use HMAC-SHA256 library instead of crypto_shash
authorEric Biggers <ebiggers@kernel.org>
Thu, 31 Jul 2025 19:25:45 +0000 (12:25 -0700)
committerMika Westerberg <mika.westerberg@linux.intel.com>
Mon, 11 Aug 2025 05:56:14 +0000 (07:56 +0200)
commit0eff12ce88e1e77c465cbaa22d450fd268cd9b74
treec5c09d5938d061f58e1e2db6a89286899d26ca74
parentdced755df3bc49e417ee4de45eec89bf5570b192
thunderbolt: Use HMAC-SHA256 library instead of crypto_shash

Use the hmac_sha256_usingrawkey() library function instead of the
"hmac(sha256)" crypto_shash.  This is simpler and faster.

As a cleanup, change the input data parameters from "challenge,
sizeof(hmac)" to "challenge, sizeof(challenge)", so that the size is
being taken of the correct buffer.  This is not a functional change,
since it happens that sizeof(hmac) == sizeof(challenge).

Replace the selection of CRYPTO and CRYPTO_HASH with CRYPTO_LIB_SHA256
and CRYPTO_LIB_UTILS.  The latter is needed for crypto_memneq() which
was previously being pulled in via CRYPTO.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/thunderbolt/Kconfig
drivers/thunderbolt/domain.c