diff options
| author | Daniel Walter <dwalter@sigma-star.at> | 2017-06-19 09:27:58 +0200 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2017-07-21 12:33:08 +0200 |
| commit | 2ed3313d497bfba43cb7b74fad2ebdfaa3a7626b (patch) | |
| tree | 3e3c4f2b56164369a66559c48dbfd3a3403e3898 /include/uapi/linux | |
| parent | 47ebb676dd55a2e8a2b63087da5776c70a0640bd (diff) | |
fscrypt: add support for AES-128-CBC
fscrypt provides facilities to use different encryption algorithms which
are selectable by userspace when setting the encryption policy. Currently,
only AES-256-XTS for file contents and AES-256-CBC-CTS for file names are
implemented. This is a clear case of kernel offers the mechanism and
userspace selects a policy. Similar to what dm-crypt and ecryptfs have.
This patch adds support for using AES-128-CBC for file contents and
AES-128-CBC-CTS for file name encryption. To mitigate watermarking
attacks, IVs are generated using the ESSIV algorithm. While AES-CBC is
actually slightly less secure than AES-XTS from a security point of view,
there is more widespread hardware support. Using AES-CBC gives us the
acceptable performance while still providing a moderate level of security
for persistent storage.
Especially low-powered embedded devices with crypto accelerators such as
CAAM or CESA often only support AES-CBC. Since using AES-CBC over AES-XTS
is basically thought of a last resort, we use AES-128-CBC over AES-256-CBC
since it has less encryption rounds and yields noticeable better
performance starting from a file size of just a few kB.
Signed-off-by: Daniel Walter <dwalter@sigma-star.at>
[david@sigma-star.at: addressed review comments]
Signed-off-by: David Gstir <david@sigma-star.at>
Reviewed-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Conflicts:
fs/crypto/crypto.c
fs/crypto/fscrypt_private.h
fs/crypto/keyinfo.c
Diffstat (limited to 'include/uapi/linux')
| -rw-r--r-- | include/uapi/linux/fs.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h index 2b7a4949a..87a962d06 100644 --- a/include/uapi/linux/fs.h +++ b/include/uapi/linux/fs.h @@ -187,6 +187,8 @@ struct inodes_stat_t { #define FS_ENCRYPTION_MODE_AES_256_GCM 2 #define FS_ENCRYPTION_MODE_AES_256_CBC 3 #define FS_ENCRYPTION_MODE_AES_256_CTS 4 +#define FS_ENCRYPTION_MODE_AES_128_CBC 5 +#define FS_ENCRYPTION_MODE_AES_128_CTS 6 struct fscrypt_policy { |
