Numerous changes were introduced to various layers: Block: removed dependency on selinux module for decision on bio merge EXT4: Added feature controlled support for HW encryption PFK: Major re-factoring, separation to eCryptfs and EXT4 sub-layers Change-Id: I9256c8736e1c16175fe3f94733dda430ccc57980 Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
104 lines
2.3 KiB
C
104 lines
2.3 KiB
C
/* Copyright (c) 2016, The Linux Foundation. All rights reserved.
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 and
|
|
* only version 2 as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef _EXT4_ICE_H
|
|
#define _EXT4_ICE_H
|
|
|
|
#include "ext4.h"
|
|
#include "ext4_crypto.h"
|
|
|
|
#ifdef CONFIG_EXT4_FS_ICE_ENCRYPTION
|
|
static inline int ext4_should_be_processed_by_ice(const struct inode *inode)
|
|
{
|
|
if (!ext4_encrypted_inode((struct inode *)inode))
|
|
return 0;
|
|
|
|
return ext4_using_hardware_encryption((struct inode *)inode);
|
|
}
|
|
|
|
static inline int ext4_is_ice_enabled(void)
|
|
{
|
|
return 1;
|
|
}
|
|
|
|
int ext4_is_aes_xts_cipher(const struct inode *inode);
|
|
|
|
char *ext4_get_ice_encryption_key(const struct inode *inode);
|
|
char *ext4_get_ice_encryption_salt(const struct inode *inode);
|
|
|
|
int ext4_is_ice_encryption_info_equal(const struct inode *inode1,
|
|
const struct inode *inode2);
|
|
|
|
static inline size_t ext4_get_ice_encryption_key_size(
|
|
const struct inode *inode)
|
|
{
|
|
return EXT4_AES_256_XTS_KEY_SIZE / 2;
|
|
}
|
|
|
|
static inline size_t ext4_get_ice_encryption_salt_size(
|
|
const struct inode *inode)
|
|
{
|
|
return EXT4_AES_256_XTS_KEY_SIZE / 2;
|
|
}
|
|
|
|
#else
|
|
static inline int ext4_should_be_processed_by_ice(const struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
static inline int ext4_is_ice_enabled(void)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline char *ext4_get_ice_encryption_key(const struct inode *inode)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline char *ext4_get_ice_encryption_salt(const struct inode *inode)
|
|
{
|
|
return NULL;
|
|
}
|
|
|
|
static inline size_t ext4_get_ice_encryption_key_size(
|
|
const struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline size_t ext4_get_ice_encryption_salt_size(
|
|
const struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int ext4_is_xts_cipher(const struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int ext4_is_ice_encryption_info_equal(
|
|
const struct inode *inode1,
|
|
const struct inode *inode2)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int ext4_is_aes_xts_cipher(const struct inode *inode)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif /* _EXT4_ICE_H */
|