summaryrefslogtreecommitdiff
path: root/cryptfs_hw.c
diff options
context:
space:
mode:
authorErfan Abdi <erfangplus@gmail.com>2019-03-08 18:18:12 +0200
committerdoc HD <doc.divxm@gmail.com>2019-06-16 18:31:49 +0300
commit5dd3cf66f2f23a079b5d99d8f961085bee819f95 (patch)
treea362a9d8ccaf0e76a0daddb8f78cb110e210971c /cryptfs_hw.c
parent16fb1c1026300d9bd1a057c5c7ca99586594fd78 (diff)
cryptfs_hw: Support devices use metadata as keyHEADp9.0
* This fixes FDE devices which uses metadata partition as encryption key. Errors: > Logcat: E Cryptfs_hw: Error::ioctl call to create encryption key for usage 1 failed with ret = -1, errno = 14 > Dmesg: scm_call failed: func id 0x72000504, ret: -2, syscall returns: 0xfffffffffffffffc, 0x0, 0x0 QSEECOM: __qseecom_set_clear_ce_key: scm call to set QSEOS_PIPE_ENC key failed : -22 QSEECOM: qseecom_wipe_key: Failed to wipe key: pipe 2, ce 0: -14 QSEECOM: qseecom_ioctl: failed to wipe encryption key: -14 Test: Boot griffin with encrypted data Signed-off-by: Erfan Abdi <erfangplus@gmail.com> Change-Id: Id7a6474fe7fe46e0d4e4ebb3b24e1ba940971df4
Diffstat (limited to 'cryptfs_hw.c')
-rw-r--r--cryptfs_hw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cryptfs_hw.c b/cryptfs_hw.c
index 2d7b600..d20deff 100644
--- a/cryptfs_hw.c
+++ b/cryptfs_hw.c
@@ -79,7 +79,9 @@ static int (*qseecom_wipe_key)(int);
#define CRYPTFS_HW_ALGO_MODE_AES_XTS 0x3
+#ifndef USE_METADATA_FOR_KEY
#define METADATA_PARTITION_NAME "/dev/block/bootdevice/by-name/metadata"
+#endif
enum cryptfs_hw_key_management_usage_type {
CRYPTFS_HW_KM_USAGE_DISK_ENCRYPTION = 0x01,
@@ -436,6 +438,7 @@ int is_ice_enabled(void)
char prop_storage[PATH_MAX];
int storage_type = 0;
+#ifndef USE_METADATA_FOR_KEY
/*
* Since HW FDE is a compile time flag (due to QSSI requirements),
* this API conflicts with Metadata encryption even when ICE is
@@ -447,6 +450,7 @@ int is_ice_enabled(void)
SLOGI("Metadata partition, returning false");
return 0;
}
+#endif
if (property_get("ro.boot.bootdevice", prop_storage, "")) {
if (strstr(prop_storage, "ufs")) {