]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: Use MD5 library for SMB1 signature calculation
authorEric Biggers <ebiggers@kernel.org>
Sun, 12 Oct 2025 01:57:35 +0000 (18:57 -0700)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Oct 2025 03:10:28 +0000 (22:10 -0500)
commitc04e55b257b42f5eb5a2c5e92ebd043fd75fe3ab
treec4062254cfca0d08c6e2e222fde7de58d7036792
parentae04b1bb06f8c1738d01dc2f9b9391c4480544e4
smb: client: Use MD5 library for SMB1 signature calculation

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

To preserve the existing behavior of MD5 signature support being
disabled when the kernel is booted with "fips=1", make
cifs_calc_signature() check fips_enabled itself.  Previously it relied
on the error from cifs_alloc_hash("md5", &server->secmech.md5).

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/cifsencrypt.c
fs/smb/client/cifsproto.h