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

Unified Diff: update_attempter.cc

Issue 6792065: AU: Detect and report public key verify failures, but continue updating. (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: fixes for review Created 9 years, 9 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
Index: update_attempter.cc
diff --git a/update_attempter.cc b/update_attempter.cc
index c9ee712809e30d7b39680bc1620dddb1d0366529..f56c0d1275ffd3dca0aeb1e720b5ac59e342a3e4 100644
--- a/update_attempter.cc
+++ b/update_attempter.cc
@@ -32,6 +32,7 @@
using base::TimeDelta;
using base::TimeTicks;
+using google::protobuf::NewPermanentCallback;
using std::make_pair;
using std::tr1::shared_ptr;
using std::string;
@@ -188,6 +189,21 @@ void UpdateAttempter::Update(const std::string& app_version,
shared_ptr<DownloadAction> download_action(
new DownloadAction(prefs_, new MultiRangeHTTPFetcher(
new LibcurlHttpFetcher(GetProxyResolver()))));
+ // This action is always initially in place to warn OS vendor of a
+ // signature failure. If it's not needed, it will be told to skip.
+ shared_ptr<OmahaRequestAction> download_signature_warning(
+ new OmahaRequestAction(
+ prefs_,
+ omaha_request_params_,
+ new OmahaEvent(
+ OmahaEvent::kTypeUpdateDownloadFinished,
+ OmahaEvent::kResultError,
+ kActionCodeDownloadPayloadPubKeyVerificationError),
+ new LibcurlHttpFetcher(GetProxyResolver())));
+ download_action->set_skip_reporting_signature_fail(
+ NewPermanentCallback(download_signature_warning.get(),
+ &OmahaRequestAction::set_should_skip,
+ true));
shared_ptr<OmahaRequestAction> download_finished_action(
new OmahaRequestAction(prefs_,
omaha_request_params_,
@@ -217,6 +233,7 @@ void UpdateAttempter::Update(const std::string& app_version,
kernel_filesystem_copier_action));
actions_.push_back(shared_ptr<AbstractAction>(download_started_action));
actions_.push_back(shared_ptr<AbstractAction>(download_action));
+ actions_.push_back(shared_ptr<AbstractAction>(download_signature_warning));
actions_.push_back(shared_ptr<AbstractAction>(download_finished_action));
actions_.push_back(shared_ptr<AbstractAction>(filesystem_verifier_action));
actions_.push_back(shared_ptr<AbstractAction>(
« download_action.h ('K') | « download_action.cc ('k') | update_attempter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698