diff options
Diffstat (limited to 'fs/ecryptfs/ecryptfs_kernel.h')
-rw-r--r-- | fs/ecryptfs/ecryptfs_kernel.h | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h index cfb4b9fed520..a9df69efadc2 100644 --- a/fs/ecryptfs/ecryptfs_kernel.h +++ b/fs/ecryptfs/ecryptfs_kernel.h | |||
@@ -172,6 +172,19 @@ ecryptfs_get_key_payload_data(struct key *key) | |||
172 | #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24 | 172 | #define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24 |
173 | #define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32) | 173 | #define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32) |
174 | 174 | ||
175 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
176 | # define ECRYPTFS_VERSIONING_MASK_MESSAGING (ECRYPTFS_VERSIONING_DEVMISC \ | ||
177 | | ECRYPTFS_VERSIONING_PUBKEY) | ||
178 | #else | ||
179 | # define ECRYPTFS_VERSIONING_MASK_MESSAGING 0 | ||
180 | #endif | ||
181 | |||
182 | #define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \ | ||
183 | | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \ | ||
184 | | ECRYPTFS_VERSIONING_XATTR \ | ||
185 | | ECRYPTFS_VERSIONING_MULTKEY \ | ||
186 | | ECRYPTFS_VERSIONING_MASK_MESSAGING \ | ||
187 | | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION) | ||
175 | struct ecryptfs_key_sig { | 188 | struct ecryptfs_key_sig { |
176 | struct list_head crypt_stat_list; | 189 | struct list_head crypt_stat_list; |
177 | char keysig[ECRYPTFS_SIG_SIZE_HEX + 1]; | 190 | char keysig[ECRYPTFS_SIG_SIZE_HEX + 1]; |
@@ -399,7 +412,9 @@ struct ecryptfs_daemon { | |||
399 | struct hlist_node euid_chain; | 412 | struct hlist_node euid_chain; |
400 | }; | 413 | }; |
401 | 414 | ||
415 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
402 | extern struct mutex ecryptfs_daemon_hash_mux; | 416 | extern struct mutex ecryptfs_daemon_hash_mux; |
417 | #endif | ||
403 | 418 | ||
404 | static inline size_t | 419 | static inline size_t |
405 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) | 420 | ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) |
@@ -604,6 +619,7 @@ int | |||
604 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, | 619 | ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value, |
605 | size_t size, int flags); | 620 | size_t size, int flags); |
606 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); | 621 | int ecryptfs_read_xattr_region(char *page_virt, struct inode *ecryptfs_inode); |
622 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
607 | int ecryptfs_process_response(struct ecryptfs_daemon *daemon, | 623 | int ecryptfs_process_response(struct ecryptfs_daemon *daemon, |
608 | struct ecryptfs_message *msg, u32 seq); | 624 | struct ecryptfs_message *msg, u32 seq); |
609 | int ecryptfs_send_message(char *data, int data_len, | 625 | int ecryptfs_send_message(char *data, int data_len, |
@@ -612,6 +628,24 @@ int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | |||
612 | struct ecryptfs_message **emsg); | 628 | struct ecryptfs_message **emsg); |
613 | int ecryptfs_init_messaging(void); | 629 | int ecryptfs_init_messaging(void); |
614 | void ecryptfs_release_messaging(void); | 630 | void ecryptfs_release_messaging(void); |
631 | #else | ||
632 | static inline int ecryptfs_init_messaging(void) | ||
633 | { | ||
634 | return 0; | ||
635 | } | ||
636 | static inline void ecryptfs_release_messaging(void) | ||
637 | { } | ||
638 | static inline int ecryptfs_send_message(char *data, int data_len, | ||
639 | struct ecryptfs_msg_ctx **msg_ctx) | ||
640 | { | ||
641 | return -ENOTCONN; | ||
642 | } | ||
643 | static inline int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx, | ||
644 | struct ecryptfs_message **emsg) | ||
645 | { | ||
646 | return -ENOMSG; | ||
647 | } | ||
648 | #endif | ||
615 | 649 | ||
616 | void | 650 | void |
617 | ecryptfs_write_header_metadata(char *virt, | 651 | ecryptfs_write_header_metadata(char *virt, |
@@ -649,12 +683,11 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs, | |||
649 | size_t offset_in_page, size_t size, | 683 | size_t offset_in_page, size_t size, |
650 | struct inode *ecryptfs_inode); | 684 | struct inode *ecryptfs_inode); |
651 | struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index); | 685 | struct page *ecryptfs_get_locked_page(struct inode *inode, loff_t index); |
652 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | ||
653 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon); | ||
654 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, | 686 | int ecryptfs_parse_packet_length(unsigned char *data, size_t *size, |
655 | size_t *length_size); | 687 | size_t *length_size); |
656 | int ecryptfs_write_packet_length(char *dest, size_t size, | 688 | int ecryptfs_write_packet_length(char *dest, size_t size, |
657 | size_t *packet_size_length); | 689 | size_t *packet_size_length); |
690 | #ifdef CONFIG_ECRYPT_FS_MESSAGING | ||
658 | int ecryptfs_init_ecryptfs_miscdev(void); | 691 | int ecryptfs_init_ecryptfs_miscdev(void); |
659 | void ecryptfs_destroy_ecryptfs_miscdev(void); | 692 | void ecryptfs_destroy_ecryptfs_miscdev(void); |
660 | int ecryptfs_send_miscdev(char *data, size_t data_size, | 693 | int ecryptfs_send_miscdev(char *data, size_t data_size, |
@@ -663,6 +696,9 @@ int ecryptfs_send_miscdev(char *data, size_t data_size, | |||
663 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); | 696 | void ecryptfs_msg_ctx_alloc_to_free(struct ecryptfs_msg_ctx *msg_ctx); |
664 | int | 697 | int |
665 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file); | 698 | ecryptfs_spawn_daemon(struct ecryptfs_daemon **daemon, struct file *file); |
699 | int ecryptfs_exorcise_daemon(struct ecryptfs_daemon *daemon); | ||
700 | int ecryptfs_find_daemon_by_euid(struct ecryptfs_daemon **daemon); | ||
701 | #endif | ||
666 | int ecryptfs_init_kthread(void); | 702 | int ecryptfs_init_kthread(void); |
667 | void ecryptfs_destroy_kthread(void); | 703 | void ecryptfs_destroy_kthread(void); |
668 | int ecryptfs_privileged_open(struct file **lower_file, | 704 | int ecryptfs_privileged_open(struct file **lower_file, |