]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: Use HMAC-SHA256 library for key generation
authorEric Biggers <ebiggers@kernel.org>
Sun, 12 Oct 2025 01:57:32 +0000 (18:57 -0700)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Oct 2025 03:10:28 +0000 (22:10 -0500)
commit4b4c6fdb25de4edc0a34b1b93cccb439e00e1f35
tree6980ab4a7818ce43af7c377b128956375ebf3b72
parentaf5fea51411224cae61d54064a55fe22020bd2b7
smb: client: Use HMAC-SHA256 library for key generation

Convert generate_key() to use the HMAC-SHA256 library instead of a
"hmac(sha256)" crypto_shash.  This is simpler and faster.  With the
library there's no need to allocate memory, no need to handle errors,
and the HMAC-SHA256 code is accessed directly without inefficient
indirect calls and other unnecessary API overhead.

Also remove the unnecessary 'hashptr' variable.

For now smb3_crypto_shash_allocate() still allocates a "hmac(sha256)"
crypto_shash.  It will be removed in a later commit.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/Kconfig
fs/smb/client/smb2transport.c