summaryrefslogtreecommitdiffstats
path: root/cryptfs_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'cryptfs_hw.c')
-rw-r--r--cryptfs_hw.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/cryptfs_hw.c b/cryptfs_hw.c
index 859b108..65618df 100644
--- a/cryptfs_hw.c
+++ b/cryptfs_hw.c
@@ -66,6 +66,8 @@
#define CRYPTFS_HW_WIPE_KEY_FAILED -8
#define CRYPTFS_HW_CREATE_KEY_FAILED -7
+#define CRYPTFS_HW_ALGO_MODE_AES_XTS 0x3
+
enum cryptfs_hw_key_management_usage_type {
CRYPTFS_HW_KM_USAGE_DISK_ENCRYPTION = 0x01,
CRYPTFS_HW_KM_USAGE_FILE_ENCRYPTION = 0x02,
@@ -171,6 +173,26 @@ static int cryptfs_hw_wipe_key(enum cryptfs_hw_key_management_usage_type usage)
return ret;
}
+#ifdef QSEECOM_IOCTL_SET_ICE_INFO
+int set_ice_param(int flag)
+{
+ int qseecom_fd, ret = -1;
+ struct qseecom_ice_data_t ice_data;
+ qseecom_fd = open("/dev/qseecom", O_RDWR);
+ if (qseecom_fd < 0)
+ return ret;
+ ice_data.flag = flag;
+ ret = ioctl(qseecom_fd, QSEECOM_IOCTL_SET_ICE_INFO, &ice_data);
+ close(qseecom_fd);
+ return ret;
+}
+#else
+int set_ice_param(int flag)
+{
+ return -1;
+}
+#endif
+
static int cryptfs_hw_clear_key(enum cryptfs_hw_key_management_usage_type usage)
{
int32_t ret;