Skip to content

Commit fe4f6c8

Browse files
committed
fscrypt: fix the test_dummy_encryption mount option
Commit f1c131b: "crypto: xts - Convert to skcipher" now fails the setkey operation if the AES key is the same as the tweak key. Previously this check was only done if FIPS mode is enabled. Now this check is also done if weak key checking was requested. This is reasonable, but since we were using the dummy key which was a constant series of 0x42 bytes, it now caused dummy encrpyption test mode to fail. Fix this by using 0x42... and 0x24... for the two keys, so they are different. Fixes: f1c131b Cc: stable@vger.kernel.org Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 7ce7d89 commit fe4f6c8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

fs/crypto/keyinfo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ int fscrypt_get_crypt_info(struct inode *inode)
248248
goto out;
249249

250250
if (fscrypt_dummy_context_enabled(inode)) {
251-
memset(raw_key, 0x42, FS_AES_256_XTS_KEY_SIZE);
251+
memset(raw_key, 0x42, keysize/2);
252+
memset(raw_key+keysize/2, 0x24, keysize - (keysize/2));
252253
goto got_key;
253254
}
254255

0 commit comments

Comments
 (0)