From 327237d13a34af622607268bc9f363d4dec2bc24 Mon Sep 17 00:00:00 2001 From: Tianjie Date: Wed, 20 Jan 2021 19:02:34 -0800 Subject: Set hashtree algorithm for verity partitions This is used in cts tests to verify that algorithms in blocklist aren't used to build the hashtree. The system properties are required to perform the check on unrooted devices. Bug: 175236047 Test: flash, getprop; atest CtsNativeVerifiedBootTestCases Change-Id: I2dcfdb06f85dbe92cde45e836dd68e7bd835020f --- init/builtins.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'init/builtins.cpp') diff --git a/init/builtins.cpp b/init/builtins.cpp index c44e03ed7..6b7d1e950 100644 --- a/init/builtins.cpp +++ b/init/builtins.cpp @@ -861,6 +861,11 @@ static Result do_verity_update_state(const BuiltinArguments& args) { // for system as root, so it has property [partition.system.verified]. std::string partition = entry.mount_point == "/" ? "system" : Basename(entry.mount_point); SetProperty("partition." + partition + ".verified", std::to_string(mode)); + + std::string hash_alg = fs_mgr_get_hashtree_algorithm(entry); + if (!hash_alg.empty()) { + SetProperty("partition." + partition + ".verified.hash_alg", hash_alg); + } } return {}; -- cgit v1.2.3