AU: Verify source rootfs/kernel hashes before applying delta.
New style full updates will not send the old rootfs hash so no check takes
place.
BUG=7562
TEST=unit tests, gmerged on device and tested with good/bad source partition
Change-Id: I65b28bf57110e4d87472d4aea59121878cde24b0
Review URL: http://codereview.chromium.org/3712003
diff --git a/delta_diff_generator.cc b/delta_diff_generator.cc
index 9659ad2..f024481 100644
--- a/delta_diff_generator.cc
+++ b/delta_diff_generator.cc
@@ -611,6 +611,7 @@
TEST_AND_RETURN_FALSE(hasher.Finalize());
const vector<char>& hash = hasher.raw_hash();
info->set_hash(hash.data(), hash.size());
+ LOG(INFO) << "hash: " << hasher.hash();
return true;
}
@@ -619,12 +620,8 @@
const string& old_rootfs,
const string& new_rootfs,
DeltaArchiveManifest* manifest) {
- if (!old_kernel.empty()) {
- TEST_AND_RETURN_FALSE(
- InitializePartitionInfo(true,
- old_kernel,
- manifest->mutable_old_kernel_info()));
- }
+ // TODO(petkov): Generate the old kernel info when we stop generating full
+ // updates for the kernel partition.
TEST_AND_RETURN_FALSE(
InitializePartitionInfo(true,
new_kernel,