platform_bootable_recovery/tests/unit
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
..
host Simulator: add the argument to keep the updated images 2019-07-30 17:11:35 -07:00
applypatch_modes_test.cpp tests: Merge recovery_component_test into recovery_unit_test. 2019-04-30 09:13:36 -07:00
applypatch_test.cpp applypatch: Add backup_source parameter to PatchPartition. 2019-09-23 11:26:48 -07:00
asn1_decoder_test.cpp Move install to separate module 2019-03-29 10:27:51 -07:00
battery_utils_test.cpp Refactor battery info querying functions into librecovery_utils. 2019-10-02 22:04:25 -07:00
bootloader_message_test.cpp Consolidate the vendor space misc usage for Pixels 2019-11-12 10:53:04 -08:00
commands_test.cpp updater: Add TransferList class. 2018-08-17 09:37:26 -07:00
dirutil_test.cpp switch to using android-base/file.h instead of android-base/test_utils.h 2018-11-14 15:49:19 -08:00
edify_test.cpp tests: Merge recovery_component_test into recovery_unit_test. 2019-04-30 09:13:36 -07:00
fuse_provider_test.cpp Support starting fuse from a block map 2019-06-20 13:53:40 -07:00
fuse_sideload_test.cpp Support starting fuse from a block map 2019-06-20 13:53:40 -07:00
install_test.cpp Force off-device package installation with FUSE 2020-02-13 19:16:38 +00:00
locale_test.cpp matches_locale no longer accept empty locales in the png file 2019-04-22 15:32:17 -07:00
minui_test.cpp minui: GRSurface::Create() computes data_size on its own. 2018-11-26 22:46:19 -08:00
package_test.cpp Track libziparchive API change. 2019-05-06 10:28:14 -07:00
parse_install_logs_test.cpp otautil: Factor out the utils that're private to recovery. 2019-10-02 10:56:46 -07:00
rangeset_test.cpp Implement FuseBlockDataProvider 2019-05-01 12:09:38 -07:00
resources_test.cpp tests: Merge recovery_component_test into recovery_unit_test. 2019-04-30 09:13:36 -07:00
screen_ui_test.cpp Move librecovery_ui to a sub-directory 2019-03-21 10:46:11 -07:00
sysutil_test.cpp Implement FuseBlockDataProvider 2019-05-01 12:09:38 -07:00
uncrypt_test.cpp tests: Merge recovery_component_test into recovery_unit_test. 2019-04-30 09:13:36 -07:00
update_verifier_test.cpp tests: Merge recovery_component_test into recovery_unit_test. 2019-04-30 09:13:36 -07:00
updater_test.cpp Some clean ups to the updater 2019-05-22 14:58:28 -07:00
verifier_test.cpp tests: Merge recovery_component_test into recovery_unit_test. 2019-04-30 09:13:36 -07:00
zip_test.cpp Track libziparchive API change. 2019-05-06 10:28:14 -07:00