Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: caam - fix non-hmac hashes

Since 6de62f15b581 ("crypto: algif_hash - Require setkey before
accept(2)"), the AF_ALG interface requires userspace to provide a key
to any algorithm that has a setkey method. However, the non-HMAC
algorithms are not keyed, so setting a key is unnecessary.

Fix this by removing the setkey method from the non-keyed hash
algorithms.

Fixes: 6de62f15b581 ("crypto: algif_hash - Require setkey before accept(2)")
Cc: <stable@vger.kernel.org>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Russell King and committed by
Herbert Xu
a0118c8b c12abf34

+1
+1
drivers/crypto/caam/caamhash.c
··· 1898 1898 template->name); 1899 1899 snprintf(alg->cra_driver_name, CRYPTO_MAX_ALG_NAME, "%s", 1900 1900 template->driver_name); 1901 + t_alg->ahash_alg.setkey = NULL; 1901 1902 } 1902 1903 alg->cra_module = THIS_MODULE; 1903 1904 alg->cra_init = caam_hash_cra_init;