platform_bootable_recovery/install
Tianjie Xu 5e6c4e9a91 Force package installation with FUSE unless the package stores on device
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_component_test - all passing

Change-Id: Ibc9b095036a2fa624e8edf6c347ed4f12aef072f
Merged-In: Ibc9b095036a2fa624e8edf6c347ed4f12aef072f
2020-01-22 22:01:46 +00:00
..
include Force package installation with FUSE unless the package stores on device 2020-01-22 22:01:46 +00:00
adb_install.cpp minadbd: Export minadbd/types.h to libinstall. 2019-09-26 00:04:11 -07:00
Android.bp Delete VINTF compatibility check during OTA. 2019-12-18 12:14:50 -08:00
asn1_decoder.cpp Move install to separate module 2019-03-29 10:27:51 -07:00
fuse_install.cpp otautil: Factor out the utils that're private to recovery. 2019-10-02 10:56:46 -07:00
install.cpp Force package installation with FUSE unless the package stores on device 2020-01-22 22:01:46 +00:00
package.cpp InstallPackage now takes a package as parameter 2019-06-13 13:36:56 -07:00
snapshot_utils.cpp Mount snapshotted /system in Virtual A/B devices 2019-12-16 21:25:45 +00:00
verifier.cpp Use the new ziparchive Next std::string_view overload. 2019-06-12 12:20:37 -07:00
wipe_data.cpp Force merges to complete before wiping data or metadata. 2019-11-11 01:02:12 +00:00
wipe_device.cpp Track libziparchive API change. 2019-05-06 10:28:14 -07:00