decrypt: AOSP 10 requires the use of fscrypt

fscrypt aosp doc: https://source.android.com/security/encryption/file-based
kernel fscrypt doc: https://www.kernel.org/doc/html/v4.18/filesystems/fscrypt.html

This commit implements the ability for TWRP to use fscrypt to decrypt
files on the fscrypt implementation. It has been implemented mostly
in a new successor library to e4crypt called libtwrpfscrypt. Most of the
code was ported from AOSP vold.

Notable updates include:
 - updated policy storage by libtar
 - lookup of fbe policies by libtwrpfscrypt
 - threaded keystore operations

Big thanks to Dees_Troy for the initial trailblazing
of encryption in TWRP.

Change-Id: I69cd2eba3693a9914e00213d4943229635d0cdae
60 files changed
tree: 6936779bf7a9b5d8ae6904e02c6f3743ad452461
  1. .github/
  2. adbbu/
  3. applypatch/
  4. attr/
  5. bmlutils/
  6. boot_control/
  7. bootloader_message/
  8. bootloader_message_twrp/
  9. crypto/
  10. dosfstools/
  11. edify/
  12. etc/
  13. exfat/
  14. fastboot/
  15. fb2png/
  16. flashutils/
  17. fonts/
  18. fuse/
  19. fuse_sideload/
  20. fuse_sideload28/
  21. gpt/
  22. gui/
  23. htcdumlock/
  24. injecttwrp/
  25. install/
  26. install28/
  27. libblkid/
  28. libcrecovery/
  29. libmincrypt/
  30. libpixelflinger/
  31. libtar/
  32. minadbd/
  33. minadbd21/
  34. minui/
  35. minui21/
  36. minuitwrp/
  37. minzip/
  38. misc_writer/
  39. mmcutils/
  40. mtdutils/
  41. mtp/
  42. openaes/
  43. orscmd/
  44. otafault/
  45. otautil/
  46. ozip_decrypt/
  47. pigz/
  48. prebuilt/
  49. recovery_ui/
  50. res/
  51. res-hdpi/
  52. res-mdpi/
  53. res-xhdpi/
  54. res-xxhdpi/
  55. res-xxxhdpi/
  56. scripts/
  57. sepolicy/
  58. simg2img/
  59. tests/
  60. tools/
  61. twrpDigest/
  62. twrpTarMain/
  63. uncrypt/
  64. update_verifier/
  65. updater/
  66. updater_sample/
  67. verifier24/
  68. verifier28/
  69. .clang-format
  70. .gitignore
  71. Android.bp
  72. Android.mk
  73. BasePartition.cpp
  74. bootloader.h
  75. CleanSpec.mk
  76. common.h
  77. data.cpp
  78. data.hpp
  79. exclude.cpp
  80. exclude.hpp
  81. find_file.cpp
  82. find_file.hpp
  83. fixContexts.cpp
  84. fixContexts.hpp
  85. fsck_unshare_blocks.cpp
  86. fsck_unshare_blocks.h
  87. fuse.h
  88. fuse_sideload22.cpp
  89. fuse_sideload22.h
  90. infomanager.cpp
  91. infomanager.hpp
  92. interlace-frames.py
  93. legacy_properties.h
  94. mounts.c
  95. NOTICE
  96. openrecoveryscript.cpp
  97. openrecoveryscript.hpp
  98. OWNERS
  99. partition.cpp
  100. partitionmanager.cpp
  101. partitions.hpp
  102. PREUPLOAD.cfg
  103. progresstracking.cpp
  104. progresstracking.hpp
  105. README.md
  106. recovery-persist.cpp
  107. recovery-persist.rc
  108. recovery-refresh.cpp
  109. recovery-refresh.rc
  110. recovery.cpp
  111. recovery.h
  112. recovery_main.cpp
  113. recovery_ui.h
  114. tarWrite.c
  115. tarWrite.h
  116. twcommon.h
  117. twinstall.cpp
  118. twinstall.h
  119. twinstallorig.cpp
  120. twinstallorig.h
  121. twrp-functions.cpp
  122. twrp-functions.hpp
  123. twrp.cpp
  124. twrpAdbBuFifo.cpp
  125. twrpAdbBuFifo.hpp
  126. twrpApex.cpp
  127. twrpApex.hpp
  128. twrpDigestDriver.cpp
  129. twrpDigestDriver.hpp
  130. twrpTar.cpp
  131. twrpTar.h
  132. twrpTar.hpp
  133. variables.h