diff options
author | Gilad Broner <gbroner@codeaurora.org> | 2016-01-11 14:07:26 +0200 |
---|---|---|
committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-25 16:04:06 -0700 |
commit | f50a4a1dc7a0196eb94bfaa18abb95dd387fee1e (patch) | |
tree | 46e88594582b5b69030c0eb224eca30a53f81da5 /include | |
parent | 53db8d989d8f077a5c8b2e41370449004b1c9199 (diff) |
eCryptfs: fixed bug in cipher handling
Cipher was sometimes not treated properly, causing valid
requests belonging to eCryptfs to be treated as regular.
Change-Id: Iabfb93cc4c9e9e167901043482eb99613ed70343
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/ecryptfs.h | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h index 55433c6c603d..33d35ea4f937 100644 --- a/include/linux/ecryptfs.h +++ b/include/linux/ecryptfs.h @@ -119,7 +119,7 @@ struct ecryptfs_auth_tok { * such as ecryptfs_get_key_size(), ecryptfs_get_cipher() etc. */ struct ecryptfs_events { - bool (*is_cipher_supported_cb)(const char *cipher); + bool (*is_cipher_supported_cb)(const void *ecrytpfs_data); void (*open_cb)(struct inode *inode, void *ecrytpfs_data); void (*release_cb)(struct inode *inode); int (*encrypt_cb)(struct page *in_page, struct page *out_page, @@ -127,26 +127,28 @@ struct ecryptfs_events { int (*decrypt_cb)(struct page *in_page, struct page *out_page, struct inode *inode, unsigned long extent_offset); bool (*is_hw_crypt_cb)(void); - size_t (*get_salt_key_size_cb)(const char *cipher); + size_t (*get_salt_key_size_cb)(const void *ecrytpfs_data); }; -int ecryptfs_register_to_events(struct ecryptfs_events *ops); +int ecryptfs_register_to_events(const struct ecryptfs_events *ops); int ecryptfs_unregister_from_events(int user_handle); -const unsigned char *ecryptfs_get_key(void *ecrytpfs_data); +const unsigned char *ecryptfs_get_key(const void *ecrytpfs_data); -size_t ecryptfs_get_key_size(void *ecrytpfs_data); +size_t ecryptfs_get_key_size(const void *ecrytpfs_data); -const unsigned char *ecryptfs_get_salt(void *ecrytpfs_data); +const unsigned char *ecryptfs_get_salt(const void *ecrytpfs_data); -size_t ecryptfs_get_salt_size(void *ecrytpfs_data); +size_t ecryptfs_get_salt_size(const void *ecrytpfs_data); -const unsigned char *ecryptfs_get_cipher(void *ecrytpfs_data); +bool ecryptfs_cipher_match(const void *ecrytpfs_data, + const unsigned char *cipher, size_t cipher_size); -bool ecryptfs_is_page_in_metadata(void *ecrytpfs_data, pgoff_t offset); +bool ecryptfs_is_page_in_metadata(const void *ecrytpfs_data, pgoff_t offset); -bool ecryptfs_is_data_equal(void *ecrytpfs_data1, void *ecrytpfs_data2); +bool ecryptfs_is_data_equal(const void *ecrytpfs_data1, + const void *ecrytpfs_data2); #endif /* _LINUX_ECRYPTFS_H */ |