Add support for using public key sent by Omaha.
This adds support for Omaha to specify what RSA public to use for
verifying both the metadata hash signature and the payload itself.
For security reasons, we only allow this for non-official builds
e.g. for official builds we keep using the key stored on the root
file-system.
Also, if the key is specified in the Omaha response then we make hash
checks mandatory; e.g. if the signatures don't check out, fail the
update.
See CL:175283 for the devserver changes to transmit the public key and
signed metadata hash.
BUG=chromium:264352
TEST=New unit tests + unit tests pass + manual testing.
Change-Id: I709be02662a484c6284bb78683b973554e482928
Reviewed-on: https://chromium-review.googlesource.com/175285
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
diff --git a/download_action_unittest.cc b/download_action_unittest.cc
index be9d170..7bb0fc5 100644
--- a/download_action_unittest.cc
+++ b/download_action_unittest.cc
@@ -149,6 +149,7 @@
0,
"",
output_temp_file.GetPath(),
+ "",
"");
ObjectFeederAction<InstallPlan> feeder_action;
feeder_action.set_obj(install_plan);
@@ -265,7 +266,7 @@
// takes ownership of passed in HttpFetcher
ObjectFeederAction<InstallPlan> feeder_action;
InstallPlan install_plan(false, false, "", 0, "", 0, "",
- temp_file.GetPath(), "");
+ temp_file.GetPath(), "", "");
feeder_action.set_obj(install_plan);
PrefsMock prefs;
DownloadAction download_action(&prefs, NULL,
@@ -374,7 +375,8 @@
0,
"",
"/dev/null",
- "/dev/null");
+ "/dev/null",
+ "");
ObjectFeederAction<InstallPlan> feeder_action;
feeder_action.set_obj(install_plan);
PrefsMock prefs;
@@ -409,7 +411,7 @@
DirectFileWriter writer;
// takes ownership of passed in HttpFetcher
- InstallPlan install_plan(false, false, "", 0, "", 0, "", path, "");
+ InstallPlan install_plan(false, false, "", 0, "", 0, "", path, "", "");
ObjectFeederAction<InstallPlan> feeder_action;
feeder_action.set_obj(install_plan);
PrefsMock prefs;
@@ -486,6 +488,7 @@
0,
"",
output_temp_file.GetPath(),
+ "",
"");
ObjectFeederAction<InstallPlan> feeder_action;
feeder_action.set_obj(install_plan);