FsCrypt update: support fscrypt policies v1 and v2
This patchset introduces support decryption for Android 11.
In this update we deprecate ext4crypt. To specify the
policy version to use, use TW_USE_FSCRYPT_POLICY := 1 or
TW_USE_FSCRYPT_POLICY := 2. By default policy version will
be set to 2 if this variable is omitted.
Change-Id: I62a29c1bef36c259ec4b11259f71be613d20a112
diff --git a/twrpTar.cpp b/twrpTar.cpp
index 6c9e758..71a5b15 100755
--- a/twrpTar.cpp
+++ b/twrpTar.cpp
@@ -57,18 +57,12 @@
#ifdef TW_INCLUDE_FBE
#ifdef USE_FSCRYPT
#include "fscrypt_policy.h"
-#else
-#include "crypto/ext4crypt/ext4crypt_tar.h"
#endif
#endif
-#ifdef TW_INCLUDE_FBE
#ifdef USE_FSCRYPT
#define TWTAR_FLAGS TAR_GNU | TAR_STORE_SELINUX | TAR_STORE_POSIX_CAP | TAR_STORE_ANDROID_USER_XATTR | TAR_STORE_FSCRYPT_POL
#else
-#define TWTAR_FLAGS TAR_GNU | TAR_STORE_SELINUX | TAR_STORE_POSIX_CAP | TAR_STORE_ANDROID_USER_XATTR | TAR_STORE_EXT4_POL
-#endif
-#else
#define TWTAR_FLAGS TAR_GNU | TAR_STORE_SELINUX | TAR_STORE_POSIX_CAP | TAR_STORE_ANDROID_USER_XATTR
#endif
@@ -90,12 +84,9 @@
input_fd = -1;
output_fd = -1;
backup_exclusions = NULL;
-#ifdef TW_INCLUDE_FBE
+
#ifdef USE_FSCRYPT
fscrypt_set_mode();
-#else
- e4crypt_set_mode();
-#endif
#endif
}