summaryrefslogtreecommitdiff
path: root/fs/crypto
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2016-12-28 03:46:27 +0300
committerTheodore Ts'o <tytso@mit.edu>2016-12-28 03:46:27 +0300
commitfe4f6c801c03bc13113d0dc32f02d4ea8ed89ffd (patch)
tree636b0df413a417e6bb976510df150e0edae9ae8f /fs/crypto
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
downloadlinux-fe4f6c801c03bc13113d0dc32f02d4ea8ed89ffd.tar.xz
fscrypt: fix the test_dummy_encryption mount option
Commit f1c131b45410a: "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: f1c131b45410a202eb45cc55980a7a9e4e4b4f40 Cc: stable@vger.kernel.org Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/crypto')
-rw-r--r--fs/crypto/keyinfo.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/crypto/keyinfo.c b/fs/crypto/keyinfo.c
index 6eeea1dcba41..95cd4c3b06c3 100644
--- a/fs/crypto/keyinfo.c
+++ b/fs/crypto/keyinfo.c
@@ -248,7 +248,8 @@ retry:
goto out;
if (fscrypt_dummy_context_enabled(inode)) {
- memset(raw_key, 0x42, FS_AES_256_XTS_KEY_SIZE);
+ memset(raw_key, 0x42, keysize/2);
+ memset(raw_key+keysize/2, 0x24, keysize - (keysize/2));
goto got_key;
}