summaryrefslogtreecommitdiff
path: root/init/builtins.cpp
diff options
context:
space:
mode:
authorTianjie <xunchang@google.com>2021-01-20 19:02:34 -0800
committerTianjie <xunchang@google.com>2021-01-20 19:02:34 -0800
commit327237d13a34af622607268bc9f363d4dec2bc24 (patch)
treece1bec251e47bf03de205bd4a406b8c5f205a17d /init/builtins.cpp
parentbccf7601ae1a6c629de0025e835173cf3355d6ff (diff)
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
Diffstat (limited to 'init/builtins.cpp')
-rw-r--r--init/builtins.cpp5
1 files changed, 5 insertions, 0 deletions
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<void> 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 {};