From 1e56c85dd8673d63897f65ef8fe9369bc8d1b313 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Sun, 3 Mar 2019 01:33:52 +0200 Subject: cryptfs_hw: Cleanup should_use_keymaster * Remove duplicated logic Change-Id: I7a644b2bb7954c9491d6111b3d9614fd9d6ac64b --- cryptfs_hw.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/cryptfs_hw.c b/cryptfs_hw.c index 482e28b..2d7b600 100644 --- a/cryptfs_hw.c +++ b/cryptfs_hw.c @@ -482,26 +482,15 @@ static int get_keymaster_version() int should_use_keymaster() { - int rc = 1; -#ifdef LEGACY_HW_DISK_ENCRYPTION - /* - * HW FDE key should be tied to keymaster only if - * new Keymaster is available - */ - if (get_keymaster_version() != KEYMASTER_MODULE_API_VERSION_1_0) { - SLOGI("Keymaster version is not 1.0"); - rc = 0; - } -#else /* * HW FDE key should be tied to keymaster * if version is above 0.3. this is to * support msm8909 go target. */ - if (get_keymaster_version() == KEYMASTER_MODULE_API_VERSION_0_3) { + int rc = 1; + if (get_keymaster_version() == KEYMASTER_MODULE_API_VERSION_0_3) { SLOGI("Keymaster version is 0.3"); rc = 0; - } -#endif - return rc; + } + return rc; } -- cgit v1.2.3