platform_bootable_recovery/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
..
include Force off-device package installation with FUSE 2020-02-13 19:16:38 +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 off-device package installation with FUSE 2020-02-13 19:16:38 +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