fscrypt: integrate v1 processing into TWRP

Change-Id: I3bf9c14b818f9c3e0570c44c82bf0769fcec907f
This commit is contained in:
bigbiff
2021-05-18 20:35:53 -04:00
parent 799243055f
commit 2e344ab7fb
11 changed files with 144 additions and 22 deletions
+5
View File
@@ -31,8 +31,13 @@ int main(int argc, char *argv[]) {
fscrypt_policy_v2 fep;
#endif
if (fscrypt_policy_get_struct(argv[1], &fep)) {
#ifdef USE_FSCRYPT_POLICY_V1
char policy_hex[FS_KEY_DESCRIPTOR_SIZE_HEX];
bytes_to_hex(fep.master_key_descriptor, FS_KEY_DESCRIPTOR_SIZE, policy_hex);
#else
char policy_hex[FSCRYPT_KEY_IDENTIFIER_HEX_SIZE];
bytes_to_hex(fep.master_key_identifier, FSCRYPT_KEY_IDENTIFIER_SIZE, policy_hex);
#endif
printf("%s\n", policy_hex);
} else {
printf("No policy set\n");