From d151a583479f475fcfb5d016d7d39dadec97ee72 Mon Sep 17 00:00:00 2001 From: Janis Danisevskis Date: Wed, 29 Mar 2017 15:19:23 -0700 Subject: [PATCH] Removed e4crypt_create_device_key Init was the only user of e4crypt_create_device_key and it is not using it any more. Bug: 36278706 Test: Removed unused code, and codebase still builds. Change-Id: Id134a2dbcaf6553353962f5b93883bb3981f217c --- ext4_utils/ext4_crypt_init_extensions.cpp | 17 ----------------- .../include/ext4_utils/ext4_crypt_init_extensions.h | 2 -- 2 files changed, 19 deletions(-) diff --git a/ext4_utils/ext4_crypt_init_extensions.cpp b/ext4_utils/ext4_crypt_init_extensions.cpp index e219d2f8..746d835c 100644 --- a/ext4_utils/ext4_crypt_init_extensions.cpp +++ b/ext4_utils/ext4_crypt_init_extensions.cpp @@ -40,23 +40,6 @@ static const std::string arbitrary_sequence_number = "42"; static const int vold_command_timeout_ms = 60 * 1000; -int e4crypt_create_device_key(const char* dir, - int ensure_dir_exists(const char*)) -{ - // Make sure folder exists. Use make_dir to set selinux permissions. - std::string unencrypted_dir = std::string(dir) + e4crypt_unencrypted_folder; - if (ensure_dir_exists(unencrypted_dir.c_str())) { - PLOG(ERROR) << "Failed to create " << unencrypted_dir; - return -1; - } - - const char* argv[] = { "/system/bin/vdc", "--wait", "cryptfs", "enablefilecrypto" }; - int rc = android_fork_execvp_ext(arraysize(argv), (char**) argv, NULL, false, - LOG_KLOG, false, NULL, NULL, 0); - LOG(INFO) << "enablefilecrypto result: " << rc; - return rc; -} - int e4crypt_install_keyring() { key_serial_t device_keyring = add_key("keyring", "e4crypt", 0, 0, diff --git a/ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h b/ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h index 2cf98de4..e208b451 100644 --- a/ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h +++ b/ext4_utils/include/ext4_utils/ext4_crypt_init_extensions.h @@ -26,8 +26,6 @@ __BEGIN_DECLS // These functions assume they are being called from init // They will not operate properly outside of init int e4crypt_install_keyring(); -int e4crypt_create_device_key(const char* path, - int ensure_dir_exists(const char* dir)); int e4crypt_set_directory_policy(const char* path); int e4crypt_do_init_user0(); -- 2.11.0