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

Side by Side Diff: download_action.cc

Issue 6778029: AU: detect failure when using public key verification (Closed) Base URL: http://git.chromium.org/git/update_engine.git@master
Patch Set: cleanup for review Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« delta_performer.cc ('K') | « delta_performer_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "update_engine/download_action.h" 5 #include "update_engine/download_action.h"
6 #include <errno.h> 6 #include <errno.h>
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 #include <glib.h> 10 #include <glib.h>
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 LOG_IF(WARNING, writer_->Close() != 0) << "Error closing the writer."; 154 LOG_IF(WARNING, writer_->Close() != 0) << "Error closing the writer.";
155 writer_ = NULL; 155 writer_ = NULL;
156 } 156 }
157 if (delegate_) { 157 if (delegate_) {
158 delegate_->SetDownloadStatus(false); // Set to inactive. 158 delegate_->SetDownloadStatus(false); // Set to inactive.
159 } 159 }
160 ActionExitCode code = 160 ActionExitCode code =
161 successful ? kActionCodeSuccess : kActionCodeDownloadTransferError; 161 successful ? kActionCodeSuccess : kActionCodeDownloadTransferError;
162 if (code == kActionCodeSuccess) { 162 if (code == kActionCodeSuccess) {
163 if (!install_plan_.is_full_update) { 163 if (!install_plan_.is_full_update) {
164 bool public_key_verify_failed = false; // TODO(adlr): don't ignore this.
164 if (!delta_performer_->VerifyPayload("", 165 if (!delta_performer_->VerifyPayload("",
165 install_plan_.download_hash, 166 install_plan_.download_hash,
166 install_plan_.size)) { 167 install_plan_.size,
168 &public_key_verify_failed)) {
167 LOG(ERROR) << "Download of " << install_plan_.download_url 169 LOG(ERROR) << "Download of " << install_plan_.download_url
168 << " failed due to payload verification error."; 170 << " failed due to payload verification error.";
169 code = kActionCodeDownloadPayloadVerificationError; 171 code = kActionCodeDownloadPayloadVerificationError;
170 } else if (!delta_performer_->GetNewPartitionInfo( 172 } else if (!delta_performer_->GetNewPartitionInfo(
171 &install_plan_.kernel_size, 173 &install_plan_.kernel_size,
172 &install_plan_.kernel_hash, 174 &install_plan_.kernel_hash,
173 &install_plan_.rootfs_size, 175 &install_plan_.rootfs_size,
174 &install_plan_.rootfs_hash)) { 176 &install_plan_.rootfs_hash)) {
175 LOG(ERROR) << "Unable to get new partition hash info."; 177 LOG(ERROR) << "Unable to get new partition hash info.";
176 code = kActionCodeDownloadNewPartitionInfoError; 178 code = kActionCodeDownloadNewPartitionInfoError;
(...skipping 23 matching lines...) Expand all
200 processor_->ActionComplete(this, code); 202 processor_->ActionComplete(this, code);
201 } 203 }
202 204
203 void DownloadAction::TransferTerminated(HttpFetcher *fetcher) { 205 void DownloadAction::TransferTerminated(HttpFetcher *fetcher) {
204 if (code_ != kActionCodeSuccess) { 206 if (code_ != kActionCodeSuccess) {
205 processor_->ActionComplete(this, code_); 207 processor_->ActionComplete(this, code_);
206 } 208 }
207 } 209 }
208 210
209 }; // namespace {} 211 }; // namespace {}
OLDNEW
« delta_performer.cc ('K') | « delta_performer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698