]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
nvme-auth: target: remove obsolete crypto_has_shash() checks
authorEric Biggers <ebiggers@kernel.org>
Mon, 2 Mar 2026 07:59:54 +0000 (23:59 -0800)
committerKeith Busch <kbusch@kernel.org>
Fri, 27 Mar 2026 14:35:02 +0000 (07:35 -0700)
commitefe8df9f9ce12903244e42038346de6afec473de
tree7c079a68a335b2a3fb75a0e394643d94a0e274b5
parentac9a49cf6e0c230e81de1c91b59e4ad912ee98c1
nvme-auth: target: remove obsolete crypto_has_shash() checks

Since nvme-auth is now doing its HMAC computations using the crypto
library, it's guaranteed that all the algorithms actually work.
Therefore, remove the crypto_has_shash() checks which are now obsolete.

However, the caller in nvmet_auth_negotiate() seems to have also been
relying on crypto_has_shash(nvme_auth_hmac_name(host_hmac_id)) to
validate the host_hmac_id.  Therefore, make it validate the ID more
directly by checking whether nvme_auth_hmac_hash_len() returns 0 or not.

Acked-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Eric Biggers <ebiggers@kernel.org>
Signed-off-by: Keith Busch <kbusch@kernel.org>
drivers/nvme/target/auth.c
drivers/nvme/target/configfs.c
drivers/nvme/target/fabrics-cmd-auth.c