platform_bootable_recovery/install/include/install
Tianjie Xu cd8faf7eee Force off-device package installation with FUSE
The non-A/B package installation is subject to TOC/TOU flaw if the
attacker can switch the package in the middle of installation. And the
most pratical case is to store the package on an external device, e.g. a
sdcard, and swap the device in the middle.

To prevent that, we can adopt the same protection as used in sideloading
a package with FUSE. Specifically, when we install the package with FUSE,
we read the entire package to cryptographically verify its signature.
The hash for each transfer block is recorded in the memory (TOC), and
the subsequent reads (TOU) will be rejected upon dectecting a mismatch.

This CL forces the package installation with FUSE when the package stays
on a removable media.

Bug: 136498130
Test: Run bin/recovery --update_package with various paths;
and packages are installed from FUSE as expected
Test: recovery_unit_test - no new failures

Change-Id: Ia5afd19854c3737110339fd59491b96708926ae5
Merged-In: I35119c2334895aa0ef4ed71b3ddd08f280c0c031
2020-02-13 19:16:38 +00:00
..
adb_install.h install: Install functions return InstallResult. 2019-04-30 13:58:03 -07:00
fuse_install.h Support starting fuse from a block map 2019-06-20 13:53:40 -07:00
install.h Force off-device package installation with FUSE 2020-02-13 19:16:38 +00:00
package.h InstallPackage now takes a package as parameter 2019-06-13 13:36:56 -07:00
snapshot_utils.h Mount snapshotted /system in Virtual A/B devices 2019-12-16 21:25:45 +00:00
verifier.h Move install to separate module 2019-03-29 10:27:51 -07:00
wipe_data.h Move load & restore logs to logging.cpp 2019-04-15 23:18:13 -07:00
wipe_device.h Add install/wipe_device.cpp. 2019-04-26 23:23:19 -07:00