releasetools: build_image.BuildVerityTree() returns a tuple.
We don't need verity_root_hash or verity_salt to be in the prop dict.
Test: `m dist` with aosp_marlin-userdebug
Test: python -m unittest test_verity_utils
Change-Id: I5a9c50f4741dfb1083b3f590136335b6bc0e5216
diff --git a/tools/releasetools/build_image.py b/tools/releasetools/build_image.py
index f1594d7..d5ab055 100755
--- a/tools/releasetools/build_image.py
+++ b/tools/releasetools/build_image.py
@@ -330,7 +330,7 @@
"Failed to build FEC data:\n{}".format(output))
-def BuildVerityTree(sparse_image_path, verity_image_path, prop_dict):
+def BuildVerityTree(sparse_image_path, verity_image_path):
cmd = ["build_verity_tree", "-A", FIXED_SALT, sparse_image_path,
verity_image_path]
output, exit_code = RunCommand(cmd)
@@ -338,8 +338,7 @@
raise BuildImageError(
"Failed to build verity tree:\n{}".format(output))
root, salt = output.split()
- prop_dict["verity_root_hash"] = root
- prop_dict["verity_salt"] = salt
+ return root, salt
def BuildVerityMetadata(image_size, verity_metadata_path, root_hash, salt,
@@ -453,11 +452,9 @@
verity_fec_path = os.path.join(tempdir_name, "verity_fec.img")
# Build the verity tree and get the root hash and salt.
- BuildVerityTree(out_file, verity_image_path, prop_dict)
+ root_hash, salt = BuildVerityTree(out_file, verity_image_path)
# Build the metadata blocks.
- root_hash = prop_dict["verity_root_hash"]
- salt = prop_dict["verity_salt"]
verity_disable = "verity_disable" in prop_dict
BuildVerityMetadata(
image_size, verity_metadata_path, root_hash, salt, block_dev, signer_path,