Verify AU payload manifest signature if present.
In order to support downloads over http for a number of reasons, we need
to secure http downloads. The first step in this process is to
verify the signature of the manifest itself before parsing. This can be
done even for https-based downloads in order to provide defense-in-depth
against a SSL attack. This CL adds the required verification logic in
update_engine, if such a manifest signature is present in the Omaha
response.
Until the delta generator is modified in a subsequent check-in to update
the manifest and payload with the required signature, none of this new
code will have any effect.
The delta generator change to populate non-zero values for these new
fields will follow in subsequent CLs.
BUG=chromium-os:33602
TEST=Tested on ZGB to make sure existing functionality works fine.
Added new unit tests.
Change-Id: I2d8b09c23faf87049893b1dee97a34e1f300aded
Reviewed-on: https://gerrit.chromium.org/gerrit/32844
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Reviewed-by: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
diff --git a/omaha_response_handler_action_unittest.cc b/omaha_response_handler_action_unittest.cc
index 9da48a6..bed0f04 100644
--- a/omaha_response_handler_action_unittest.cc
+++ b/omaha_response_handler_action_unittest.cc
@@ -104,7 +104,7 @@
InstallPlan install_plan;
EXPECT_TRUE(DoTest(in, "/dev/sda3", &install_plan));
EXPECT_EQ(in.codebase, install_plan.download_url);
- EXPECT_EQ(in.hash, install_plan.download_hash);
+ EXPECT_EQ(in.hash, install_plan.payload_hash);
EXPECT_EQ("/dev/sda5", install_plan.install_path);
string deadline;
EXPECT_TRUE(utils::ReadFile(
@@ -130,7 +130,7 @@
InstallPlan install_plan;
EXPECT_TRUE(DoTest(in, "/dev/sda5", &install_plan));
EXPECT_EQ(in.codebase, install_plan.download_url);
- EXPECT_EQ(in.hash, install_plan.download_hash);
+ EXPECT_EQ(in.hash, install_plan.payload_hash);
EXPECT_EQ("/dev/sda3", install_plan.install_path);
string deadline;
EXPECT_TRUE(utils::ReadFile(
@@ -151,7 +151,7 @@
InstallPlan install_plan;
EXPECT_TRUE(DoTest(in, "/dev/sda3", &install_plan));
EXPECT_EQ(in.codebase, install_plan.download_url);
- EXPECT_EQ(in.hash, install_plan.download_hash);
+ EXPECT_EQ(in.hash, install_plan.payload_hash);
EXPECT_EQ("/dev/sda5", install_plan.install_path);
string deadline;
EXPECT_TRUE(utils::ReadFile(
@@ -167,7 +167,7 @@
InstallPlan install_plan;
EXPECT_FALSE(DoTest(in, "/dev/sda1", &install_plan));
EXPECT_EQ("", install_plan.download_url);
- EXPECT_EQ("", install_plan.download_hash);
+ EXPECT_EQ("", install_plan.payload_hash);
EXPECT_EQ("", install_plan.install_path);
}