OSDN Git Service

Add e4crypt_set_user_crypto_policies, calls vdc setusercryptopolicies
authorPaul Crowley <paulcrowley@google.com>
Thu, 28 May 2015 15:45:52 +0000 (16:45 +0100)
committerPaul Crowley <paulcrowley@google.com>
Thu, 9 Jul 2015 17:09:17 +0000 (18:09 +0100)
Bug: 19704432
(cherry picked from commit 09d3fdffad0ccbed36f0ece966e85aed23c626d7)

Change-Id: Ib7ef9365063ed69774169b22071f2a42d2f5ef21

ext4_utils/ext4_crypt_init_extensions.cpp
ext4_utils/ext4_crypt_init_extensions.h

index e1b69e1..5e167a5 100644 (file)
@@ -164,3 +164,13 @@ int e4crypt_set_directory_policy(const char* dir)
 
     return 0;
 }
+
+int e4crypt_set_user_crypto_policies(const char* dir)
+{
+    auto command = std::string() + "cryptfs setusercryptopolicies " + dir;
+    auto result = vold_command(command);
+    // ext4enc:TODO proper error handling
+    KLOG_INFO(TAG, "setusercryptopolicies returned with result %s\n",
+              result.c_str());
+    return 0;
+}
index 7931124..d02d181 100644 (file)
@@ -11,5 +11,6 @@ int e4crypt_create_device_key(const char* path,
 int e4crypt_set_directory_policy(const char* path);
 bool e4crypt_non_default_key(const char* path);
 int do_policy_set(const char *directory, const char *policy, int policy_length);
+int e4crypt_set_user_crypto_policies(const char* path);
 
 __END_DECLS