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

Unified Diff: download_action.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: download_action.cc
diff --git a/download_action.cc b/download_action.cc
index 9577047de5f49c55fc6d6540baf02edc50ba7a05..933cbddf879841098a9b84070bfa41206ea402da 100644
--- a/download_action.cc
+++ b/download_action.cc
@@ -27,7 +27,8 @@ DownloadAction::DownloadAction(PrefsInterface* prefs,
http_fetcher_(http_fetcher),
code_(kActionCodeSuccess),
delegate_(NULL),
- bytes_received_(0) {}
+ bytes_received_(0),
+ skip_reporting_signature_fail_(NULL) {}
DownloadAction::~DownloadAction() {}
@@ -157,6 +158,7 @@ void DownloadAction::TransferComplete(HttpFetcher *fetcher, bool successful) {
if (delegate_) {
delegate_->SetDownloadStatus(false); // Set to inactive.
}
+ bool signature_verify_failed = false;
ActionExitCode code =
successful ? kActionCodeSuccess : kActionCodeDownloadTransferError;
if (code == kActionCodeSuccess) {
@@ -164,7 +166,7 @@ void DownloadAction::TransferComplete(HttpFetcher *fetcher, bool successful) {
if (!delta_performer_->VerifyPayload("",
install_plan_.download_hash,
install_plan_.size,
- NULL)) {
+ &signature_verify_failed)) {
LOG(ERROR) << "Download of " << install_plan_.download_url
<< " failed due to payload verification error.";
code = kActionCodeDownloadPayloadVerificationError;
@@ -193,6 +195,12 @@ void DownloadAction::TransferComplete(HttpFetcher *fetcher, bool successful) {
}
}
+ if (skip_reporting_signature_fail_.get() &&
+ (code != kActionCodeSuccess || !signature_verify_failed)) {
+ LOG(INFO) << "Suppressing signature pub key verification warning";
+ skip_reporting_signature_fail_->Run();
+ }
+
FlushLinuxCaches();
// Write the path to the output pipe if we're successful.
« download_action.h ('K') | « download_action.h ('k') | update_attempter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698