platform_bootable_recovery/install
Tianjie Xu 58a27693b2 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

Change-Id: Ibc9b095036a2fa624e8edf6c347ed4f12aef072f
2019-10-16 11:35:17 -07:00
..
include Force package installation with FUSE unless the package stores on device 2019-10-16 11:35:17 -07:00
adb_install.cpp minadbd: Export minadbd/types.h to libinstall. 2019-09-26 00:04:11 -07:00
Android.bp otautil: Factor out the utils that're private to recovery. 2019-10-02 10:56:46 -07: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 2019-10-16 11:35:17 -07:00
package.cpp InstallPackage now takes a package as parameter 2019-06-13 13:36:56 -07:00
verifier.cpp Use the new ziparchive Next std::string_view overload. 2019-06-12 12:20:37 -07:00
wipe_data.cpp otautil: Factor out the utils that're private to recovery. 2019-10-02 10:56:46 -07:00
wipe_device.cpp Track libziparchive API change. 2019-05-06 10:28:14 -07:00