]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
sctp: Use HMAC-SHA1 and HMAC-SHA256 library for chunk authentication
authorEric Biggers <ebiggers@kernel.org>
Mon, 18 Aug 2025 20:54:24 +0000 (13:54 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 02:36:25 +0000 (19:36 -0700)
commitbf40785fa437c1752117df2edb3220e9c37d98a6
treef0a48bb5ed7593432e895d31ce66ae4adf63bfc9
parentdd91c79e4f58fbe2898dac84858033700e0e99fb
sctp: Use HMAC-SHA1 and HMAC-SHA256 library for chunk authentication

For SCTP chunk authentication, use the HMAC-SHA1 and HMAC-SHA256 library
functions instead of crypto_shash.  This is simpler and faster.  There's
no longer any need to pre-allocate 'crypto_shash' objects; the SCTP code
now simply calls into the HMAC code directly.

As part of this, make SCTP always support both HMAC-SHA1 and
HMAC-SHA256.  Previously, it only guaranteed support for HMAC-SHA1.
However, HMAC-SHA256 tended to be supported too anyway, as it was
supported if CONFIG_CRYPTO_SHA256 was enabled elsewhere in the kconfig.

Acked-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Link: https://patch.msgid.link/20250818205426.30222-4-ebiggers@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/net/sctp/auth.h
include/net/sctp/constants.h
include/net/sctp/structs.h
net/sctp/Kconfig
net/sctp/auth.c
net/sctp/chunk.c
net/sctp/sm_make_chunk.c
net/sctp/sm_statefuns.c
net/sctp/socket.c