]> Gentwo Git Trees - linux/.git/commit
tpm: Use HMAC-SHA256 library instead of open-coded HMAC
authorEric Biggers <ebiggers@kernel.org>
Fri, 1 Aug 2025 21:24:22 +0000 (14:24 -0700)
committerJarkko Sakkinen <jarkko@kernel.org>
Fri, 10 Oct 2025 05:21:45 +0000 (08:21 +0300)
commit64a7cfbcf548bb955220c15c39531befe0611475
tree7618486bd9a3606afda98c5198a77b760c830daf
parent2c2615c8423890b5ef8e0a186b65607ef5fdeda1
tpm: Use HMAC-SHA256 library instead of open-coded HMAC

Now that there are easy-to-use HMAC-SHA256 library functions, use these
in tpm2-sessions.c instead of open-coding the HMAC algorithm.

Note that the new implementation correctly handles keys longer than 64
bytes (SHA256_BLOCK_SIZE), whereas the old implementation handled such
keys incorrectly.  But it doesn't appear that such keys were being used.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
drivers/char/tpm/tpm2-sessions.c