diff options
author | Theodore Ts'o <tytso@mit.edu> | 2015-05-01 16:56:45 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2015-05-01 16:56:45 -0400 |
commit | 5de0b4d0cd153c471640b13aae6ae6d18d0a4603 (patch) | |
tree | ea42bad982e25f1c880e363b55e8d1ff82e773fe /fs/ext4/ext4.h | |
parent | 6ddb2447846a8ece111e316a2863c2355023682d (diff) |
ext4 crypto: simplify and speed up filename encryption
Avoid using SHA-1 when calculating the user-visible filename when the
encryption key is available, and avoid decrypting lots of filenames
when searching for a directory entry in a directory block.
Change-Id: If4655f144784978ba0305b597bfa1c8d7bb69e63
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/ext4.h')
-rw-r--r-- | fs/ext4/ext4.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h index 0179654faf79..dfb113816672 100644 --- a/fs/ext4/ext4.h +++ b/fs/ext4/ext4.h | |||
@@ -2093,9 +2093,11 @@ u32 ext4_fname_crypto_round_up(u32 size, u32 blksize); | |||
2093 | int ext4_fname_crypto_alloc_buffer(struct ext4_fname_crypto_ctx *ctx, | 2093 | int ext4_fname_crypto_alloc_buffer(struct ext4_fname_crypto_ctx *ctx, |
2094 | u32 ilen, struct ext4_str *crypto_str); | 2094 | u32 ilen, struct ext4_str *crypto_str); |
2095 | int _ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, | 2095 | int _ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, |
2096 | struct dx_hash_info *hinfo, | ||
2096 | const struct ext4_str *iname, | 2097 | const struct ext4_str *iname, |
2097 | struct ext4_str *oname); | 2098 | struct ext4_str *oname); |
2098 | int ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, | 2099 | int ext4_fname_disk_to_usr(struct ext4_fname_crypto_ctx *ctx, |
2100 | struct dx_hash_info *hinfo, | ||
2099 | const struct ext4_dir_entry_2 *de, | 2101 | const struct ext4_dir_entry_2 *de, |
2100 | struct ext4_str *oname); | 2102 | struct ext4_str *oname); |
2101 | int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx, | 2103 | int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx, |
@@ -2104,11 +2106,12 @@ int ext4_fname_usr_to_disk(struct ext4_fname_crypto_ctx *ctx, | |||
2104 | int ext4_fname_usr_to_hash(struct ext4_fname_crypto_ctx *ctx, | 2106 | int ext4_fname_usr_to_hash(struct ext4_fname_crypto_ctx *ctx, |
2105 | const struct qstr *iname, | 2107 | const struct qstr *iname, |
2106 | struct dx_hash_info *hinfo); | 2108 | struct dx_hash_info *hinfo); |
2107 | int ext4_fname_disk_to_hash(struct ext4_fname_crypto_ctx *ctx, | ||
2108 | const struct ext4_dir_entry_2 *de, | ||
2109 | struct dx_hash_info *hinfo); | ||
2110 | int ext4_fname_crypto_namelen_on_disk(struct ext4_fname_crypto_ctx *ctx, | 2109 | int ext4_fname_crypto_namelen_on_disk(struct ext4_fname_crypto_ctx *ctx, |
2111 | u32 namelen); | 2110 | u32 namelen); |
2111 | int ext4_fname_match(struct ext4_fname_crypto_ctx *ctx, struct ext4_str *cstr, | ||
2112 | int len, const char * const name, | ||
2113 | struct ext4_dir_entry_2 *de); | ||
2114 | |||
2112 | 2115 | ||
2113 | #ifdef CONFIG_EXT4_FS_ENCRYPTION | 2116 | #ifdef CONFIG_EXT4_FS_ENCRYPTION |
2114 | void ext4_put_fname_crypto_ctx(struct ext4_fname_crypto_ctx **ctx); | 2117 | void ext4_put_fname_crypto_ctx(struct ext4_fname_crypto_ctx **ctx); |