@@ -172,6 +172,19 @@ ecryptfs_get_key_payload_data(struct key *key)
172172#define ECRYPTFS_FNEK_ENCRYPTED_FILENAME_PREFIX_SIZE 24
173173#define ECRYPTFS_ENCRYPTED_DENTRY_NAME_LEN (18 + 1 + 4 + 1 + 32)
174174
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)
175188struct ecryptfs_key_sig {
176189 struct list_head crypt_stat_list ;
177190 char keysig [ECRYPTFS_SIG_SIZE_HEX + 1 ];
@@ -399,7 +412,9 @@ struct ecryptfs_daemon {
399412 struct hlist_node euid_chain ;
400413};
401414
415+ #ifdef CONFIG_ECRYPT_FS_MESSAGING
402416extern struct mutex ecryptfs_daemon_hash_mux ;
417+ #endif
403418
404419static inline size_t
405420ecryptfs_lower_header_size (struct ecryptfs_crypt_stat * crypt_stat )
604619ecryptfs_setxattr (struct dentry * dentry , const char * name , const void * value ,
605620 size_t size , int flags );
606621int ecryptfs_read_xattr_region (char * page_virt , struct inode * ecryptfs_inode );
622+ #ifdef CONFIG_ECRYPT_FS_MESSAGING
607623int ecryptfs_process_response (struct ecryptfs_daemon * daemon ,
608624 struct ecryptfs_message * msg , u32 seq );
609625int ecryptfs_send_message (char * data , int data_len ,
@@ -612,6 +628,24 @@ int ecryptfs_wait_for_response(struct ecryptfs_msg_ctx *msg_ctx,
612628 struct ecryptfs_message * * emsg );
613629int ecryptfs_init_messaging (void );
614630void 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
615649
616650void
617651ecryptfs_write_header_metadata (char * virt ,
@@ -649,12 +683,11 @@ int ecryptfs_read_lower_page_segment(struct page *page_for_ecryptfs,
649683 size_t offset_in_page , size_t size ,
650684 struct inode * ecryptfs_inode );
651685struct 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 );
654686int ecryptfs_parse_packet_length (unsigned char * data , size_t * size ,
655687 size_t * length_size );
656688int ecryptfs_write_packet_length (char * dest , size_t size ,
657689 size_t * packet_size_length );
690+ #ifdef CONFIG_ECRYPT_FS_MESSAGING
658691int ecryptfs_init_ecryptfs_miscdev (void );
659692void ecryptfs_destroy_ecryptfs_miscdev (void );
660693int ecryptfs_send_miscdev (char * data , size_t data_size ,
@@ -663,6 +696,9 @@ int ecryptfs_send_miscdev(char *data, size_t data_size,
663696void ecryptfs_msg_ctx_alloc_to_free (struct ecryptfs_msg_ctx * msg_ctx );
664697int
665698ecryptfs_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
666702int ecryptfs_init_kthread (void );
667703void ecryptfs_destroy_kthread (void );
668704int ecryptfs_privileged_open (struct file * * lower_file ,
0 commit comments