From ad2e188c0e46d44c8a1951cde429aa694d498df8 Mon Sep 17 00:00:00 2001 From: Mr NeilBrown Date: Tue, 10 Mar 2020 16:34:41 -0400 Subject: [PATCH] LU-13344 libcfs: adler32: don't set CRYPTO_TFM_RES_BAD_KEY_LEN This flag was not being checked by most callers and has been removed since Commit 674f368a952c ("crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN") so remove from lustre too. Change-Id: Ia616430a98d05c7bb3b22a0be543e83855272d2f Test-Parameters: trivial Signed-off-by: Mr NeilBrown Reviewed-on: https://review.whamcloud.com/37870 Reviewed-by: James Simmons Reviewed-by: Shaun Tancheff Tested-by: jenkins Tested-by: Maloo Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- libcfs/libcfs/linux-crypto-adler.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/libcfs/libcfs/linux-crypto-adler.c b/libcfs/libcfs/linux-crypto-adler.c index ee47fb5..5b21ef7 100644 --- a/libcfs/libcfs/linux-crypto-adler.c +++ b/libcfs/libcfs/linux-crypto-adler.c @@ -51,10 +51,9 @@ static int adler32_setkey(struct crypto_shash *hash, const u8 *key, { u32 *mctx = crypto_shash_ctx(hash); - if (keylen != sizeof(u32)) { - crypto_shash_set_flags(hash, CRYPTO_TFM_RES_BAD_KEY_LEN); + if (keylen != sizeof(u32)) return -EINVAL; - } + *mctx = *(u32 *)key; return 0; } -- 1.8.3.1