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

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: merge master 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
« no previous file with comments | « 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (!delta_performer_->VerifyPayload("", 164 if (!delta_performer_->VerifyPayload("",
165 install_plan_.download_hash, 165 install_plan_.download_hash,
166 install_plan_.size)) { 166 install_plan_.size,
167 NULL)) {
167 LOG(ERROR) << "Download of " << install_plan_.download_url 168 LOG(ERROR) << "Download of " << install_plan_.download_url
168 << " failed due to payload verification error."; 169 << " failed due to payload verification error.";
169 code = kActionCodeDownloadPayloadVerificationError; 170 code = kActionCodeDownloadPayloadVerificationError;
170 } else if (!delta_performer_->GetNewPartitionInfo( 171 } else if (!delta_performer_->GetNewPartitionInfo(
171 &install_plan_.kernel_size, 172 &install_plan_.kernel_size,
172 &install_plan_.kernel_hash, 173 &install_plan_.kernel_hash,
173 &install_plan_.rootfs_size, 174 &install_plan_.rootfs_size,
174 &install_plan_.rootfs_hash)) { 175 &install_plan_.rootfs_hash)) {
175 LOG(ERROR) << "Unable to get new partition hash info."; 176 LOG(ERROR) << "Unable to get new partition hash info.";
176 code = kActionCodeDownloadNewPartitionInfoError; 177 code = kActionCodeDownloadNewPartitionInfoError;
(...skipping 23 matching lines...) Expand all
200 processor_->ActionComplete(this, code); 201 processor_->ActionComplete(this, code);
201 } 202 }
202 203
203 void DownloadAction::TransferTerminated(HttpFetcher *fetcher) { 204 void DownloadAction::TransferTerminated(HttpFetcher *fetcher) {
204 if (code_ != kActionCodeSuccess) { 205 if (code_ != kActionCodeSuccess) {
205 processor_->ActionComplete(this, code_); 206 processor_->ActionComplete(this, code_);
206 } 207 }
207 } 208 }
208 209
209 }; // namespace {} 210 }; // namespace {}
OLDNEW
« no previous file with comments | « delta_performer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698