1 fscrypt: move the policy flags and encryption mode definitions to uapi header
3 These constants are part of the UAPI, so they belong in
4 include/uapi/linux/fs.h instead of include/linux/fscrypto.h
6 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
9 include/linux/fscrypto.h | 14 --------------
10 include/uapi/linux/fs.h | 14 ++++++++++++++
11 2 files changed, 14 insertions(+), 14 deletions(-)
13 diff --git a/include/linux/fscrypto.h b/include/linux/fscrypto.h
14 index 71e8a20711ec..42ef82d60790 100644
15 --- a/include/linux/fscrypto.h
16 +++ b/include/linux/fscrypto.h
18 #include <crypto/skcipher.h>
19 #include <uapi/linux/fs.h>
21 -#define FS_POLICY_FLAGS_PAD_4 0x00
22 -#define FS_POLICY_FLAGS_PAD_8 0x01
23 -#define FS_POLICY_FLAGS_PAD_16 0x02
24 -#define FS_POLICY_FLAGS_PAD_32 0x03
25 -#define FS_POLICY_FLAGS_PAD_MASK 0x03
26 -#define FS_POLICY_FLAGS_VALID 0x03
28 -/* Encryption algorithms */
29 -#define FS_ENCRYPTION_MODE_INVALID 0
30 -#define FS_ENCRYPTION_MODE_AES_256_XTS 1
31 -#define FS_ENCRYPTION_MODE_AES_256_GCM 2
32 -#define FS_ENCRYPTION_MODE_AES_256_CBC 3
33 -#define FS_ENCRYPTION_MODE_AES_256_CTS 4
35 #define FS_CRYPTO_BLOCK_SIZE 16
38 diff --git a/include/uapi/linux/fs.h b/include/uapi/linux/fs.h
39 index acb2b6152ba0..0496d37abe28 100644
40 --- a/include/uapi/linux/fs.h
41 +++ b/include/uapi/linux/fs.h
42 @@ -254,6 +254,20 @@ struct fsxattr {
43 /* Policy provided via an ioctl on the topmost directory */
44 #define FS_KEY_DESCRIPTOR_SIZE 8
46 +#define FS_POLICY_FLAGS_PAD_4 0x00
47 +#define FS_POLICY_FLAGS_PAD_8 0x01
48 +#define FS_POLICY_FLAGS_PAD_16 0x02
49 +#define FS_POLICY_FLAGS_PAD_32 0x03
50 +#define FS_POLICY_FLAGS_PAD_MASK 0x03
51 +#define FS_POLICY_FLAGS_VALID 0x03
53 +/* Encryption algorithms */
54 +#define FS_ENCRYPTION_MODE_INVALID 0
55 +#define FS_ENCRYPTION_MODE_AES_256_XTS 1
56 +#define FS_ENCRYPTION_MODE_AES_256_GCM 2
57 +#define FS_ENCRYPTION_MODE_AES_256_CBC 3
58 +#define FS_ENCRYPTION_MODE_AES_256_CTS 4
60 struct fscrypt_policy {
62 __u8 contents_encryption_mode;