summaryrefslogtreecommitdiffstats
path: root/crypto/ext4crypt/e4policyget.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2017-10-01 05:22:13 +0200
committerEthan Yonker <dees_troy@teamw.in>2017-11-28 23:03:41 +0100
commitfefe5915b06a1121d885fba3680dd1b90027fd5d (patch)
tree2370923b618bdbe2592873cd311944628a1d0a62 /crypto/ext4crypt/e4policyget.cpp
parentMerge "Support v2 fstab format" into android-8.0 (diff)
downloadandroid_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.tar
android_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.tar.gz
android_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.tar.bz2
android_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.tar.lz
android_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.tar.xz
android_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.tar.zst
android_bootable_recovery-fefe5915b06a1121d885fba3680dd1b90027fd5d.zip
Diffstat (limited to '')
-rw-r--r--crypto/ext4crypt/e4policyget.cpp9
1 files changed, 3 insertions, 6 deletions
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");