]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
mptcp: use HMAC-SHA256 library instead of open-coded HMAC
authorEric Biggers <ebiggers@kernel.org>
Tue, 2 Sep 2025 21:11:33 +0000 (23:11 +0200)
committerJakub Kicinski <kuba@kernel.org>
Wed, 3 Sep 2025 22:08:20 +0000 (15:08 -0700)
commit2d5be5629ce73522d1c739579d6e8e450de8685e
tree5e754ae4c43a0da0f6335102631bccecd9f64989
parent0e2a5208cc3ddd23560eca909f9b41d17e69fc58
mptcp: use HMAC-SHA256 library instead of open-coded HMAC

Now that there are easy-to-use HMAC-SHA256 library functions, use these
in net/mptcp/crypto.c instead of open-coding the HMAC algorithm.

Remove the WARN_ON_ONCE() for messages longer than SHA256_DIGEST_SIZE.
The new implementation handles all message lengths correctly.

The mptcp-crypto KUnit test still passes after this change.

Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
Link: https://patch.msgid.link/20250902-net-next-mptcp-misc-feat-6-18-v2-1-fa02bb3188b1@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/crypto.c