From fefe5915b06a1121d885fba3680dd1b90027fd5d Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Sat, 30 Sep 2017 22:22:13 -0500 Subject: FBE for Pixel 2 Includes various minor fixes for building in Android 8 trees with r23+ tag Update FBE extended header in libtar to version 2 and include the entire ext4_encryption_policy structure now after translating the policy. See this post for more details: https://plus.google.com/u/1/+DeesTroy/posts/i33ygUi7tiu Change-Id: I2af981e51f459b17fcd895fb8c2d3f6c8200e24b --- crypto/ext4crypt/e4policyget.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'crypto/ext4crypt/e4policyget.cpp') diff --git a/crypto/ext4crypt/e4policyget.cpp b/crypto/ext4crypt/e4policyget.cpp index d217f18ee..05de86fe7 100644 --- a/crypto/ext4crypt/e4policyget.cpp +++ b/crypto/ext4crypt/e4policyget.cpp @@ -28,13 +28,10 @@ int main(int argc, char *argv[]) { printf("Must specify a path\n"); return -1; } else { - char e4crypt_policy[EXT4_KEY_DESCRIPTOR_SIZE]; - if (e4crypt_policy_get(argv[1], e4crypt_policy, EXT4_KEY_DESCRIPTOR_SIZE, 0)) - { - char* ptr = tar_policy; - memset(tar_policy, 0, sizeof(tar_policy)); + ext4_encryption_policy eep; + if (e4crypt_policy_get_struct(argv[1], &eep, sizeof(eep))) { char policy_hex[EXT4_KEY_DESCRIPTOR_SIZE_HEX]; - policy_to_hex(e4crypt_policy, policy_hex); + policy_to_hex(eep.master_key_descriptor, policy_hex); printf("%s\n", policy_hex); } else { printf("No policy set\n"); -- cgit v1.2.3