[PATCH v2 2/6] fscrypt: Drop FORBID_WEAK_KEYS flag for AES-ECB

Eric Biggers ebiggers at kernel.org
Wed Jul 9 23:07:49 PDT 2025


This flag only has an effect for DES, 3DES, and XTS mode.  It does
nothing for AES-ECB, as there is no concept of weak keys for AES.

Signed-off-by: Eric Biggers <ebiggers at kernel.org>
---
 fs/crypto/keysetup_v1.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/crypto/keysetup_v1.c b/fs/crypto/keysetup_v1.c
index 3fdf174384f3d..75b0f1211a1e6 100644
--- a/fs/crypto/keysetup_v1.c
+++ b/fs/crypto/keysetup_v1.c
@@ -57,11 +57,10 @@ static int derive_key_aes(const u8 *master_key,
 	if (IS_ERR(tfm)) {
 		res = PTR_ERR(tfm);
 		tfm = NULL;
 		goto out;
 	}
-	crypto_skcipher_set_flags(tfm, CRYPTO_TFM_REQ_FORBID_WEAK_KEYS);
 	req = skcipher_request_alloc(tfm, GFP_KERNEL);
 	if (!req) {
 		res = -ENOMEM;
 		goto out;
 	}
-- 
2.50.1




More information about the linux-mtd mailing list