Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: omaha_response_handler_action.cc

Issue 6574009: If a public key is present, disallow old style full payloads. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/update_engine.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « omaha_response_handler_action.h ('k') | omaha_response_handler_action_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: omaha_response_handler_action.cc
diff --git a/omaha_response_handler_action.cc b/omaha_response_handler_action.cc
index fdbd80a6fcb2fdacb7a54af842f58b94d835c288..74e149f33c76dc52219d99db209382870ad34e96 100644
--- a/omaha_response_handler_action.cc
+++ b/omaha_response_handler_action.cc
@@ -19,6 +19,11 @@ namespace chromeos_update_engine {
const char OmahaResponseHandlerAction::kDeadlineFile[] =
"/tmp/update-check-response-deadline";
+OmahaResponseHandlerAction::OmahaResponseHandlerAction(PrefsInterface* prefs)
+ : prefs_(prefs),
+ got_no_update_response_(false),
+ key_path_(DeltaPerformer::kUpdatePayloadPublicKeyPath) {}
+
void OmahaResponseHandlerAction::PerformAction() {
CHECK(HasInputObject());
ScopedActionCompleter completer(processor_, this);
@@ -49,6 +54,11 @@ void OmahaResponseHandlerAction::PerformAction() {
utils::BootKernelDevice(install_plan_.install_path);
install_plan_.is_full_update = !response.is_delta;
+ if (!response.is_delta && utils::FileExists(key_path_.c_str())) {
+ // Can't sign old style full payloads but signature is required so bail out.
+ completer.set_code(kActionCodeSignedDeltaPayloadExpectedError);
+ return;
+ }
TEST_AND_RETURN(HasOutputPipe());
if (HasOutputPipe())
« no previous file with comments | « omaha_response_handler_action.h ('k') | omaha_response_handler_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698