diff options
author | Tianjie Xu <xunchang@google.com> | 2018-08-01 16:40:00 -0700 |
---|---|---|
committer | Tianjie Xu <xunchang@google.com> | 2018-08-06 12:17:50 -0700 |
commit | 69ffa15338503376c2dad1e33d23ebb42fba60d1 (patch) | |
tree | ec8de3151e9a221a500ede59dc7fc2fb380e4d53 /updater/commands.cpp | |
parent | 6f1f2c811acba2b2b7b5dc965c5cba350c30d039 (diff) | |
download | android_bootable_recovery-69ffa15338503376c2dad1e33d23ebb42fba60d1.tar.gz android_bootable_recovery-69ffa15338503376c2dad1e33d23ebb42fba60d1.tar.bz2 android_bootable_recovery-69ffa15338503376c2dad1e33d23ebb42fba60d1.zip |
Add an updater function to compute hash tree
The new command is part of the transfer.list and allows us to compute the hash
tree on non-ab devices.
The required arguments for the hash_tree computation are:
hash_tree_ranges
source_ranges
hash_algorithm
salt_hex
root_hash
Bug: 25170618
Test: unit tests pass; run simulator with compute_hash_tree
Change-Id: I8ff0d582cc8adabb8a060db7845f38b35b28e62c
Diffstat (limited to 'updater/commands.cpp')
-rw-r--r-- | updater/commands.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/updater/commands.cpp b/updater/commands.cpp index e8814967..15a787c5 100644 --- a/updater/commands.cpp +++ b/updater/commands.cpp @@ -40,6 +40,8 @@ Command::Type Command::ParseType(const std::string& type_str) { return Type::ABORT; } else if (type_str == "bsdiff") { return Type::BSDIFF; + } else if (type_str == "compute_hash_tree") { + return Type::COMPUTE_HASH_TREE; } else if (type_str == "erase") { return Type::ERASE; } else if (type_str == "free") { @@ -175,6 +177,7 @@ Command Command::Parse(const std::string& line, size_t index, std::string* err) SourceInfo source_info; StashInfo stash_info; + // TODO(xunchang) add the parse code of compute_hash_tree if (op == Type::ZERO || op == Type::NEW || op == Type::ERASE) { // zero/new/erase <rangeset> if (pos + 1 != tokens.size()) { |