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

Side by Side Diff: src/platform/vboot_reference/utils/firmware_utility.cc

Issue 1280002: Move test utility functions to a common place. (Closed)
Patch Set: . Created 10 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 unified diff | Download patch
« no previous file with comments | « src/platform/vboot_reference/utils/firmware_image.c ('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 // Utility for manipulating verified boot firmware images. 5 // Utility for manipulating verified boot firmware images.
6 // 6 //
7 7
8 #include "firmware_utility.h" 8 #include "firmware_utility.h"
9 9
10 #include <errno.h> 10 #include <errno.h>
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 219
220 if (!root_key_pub_) { 220 if (!root_key_pub_) {
221 cerr << "Couldn't read pre-processed public root key.\n"; 221 cerr << "Couldn't read pre-processed public root key.\n";
222 return false; 222 return false;
223 } 223 }
224 224
225 if (!image_) { 225 if (!image_) {
226 cerr << "Couldn't read firmware image or malformed image.\n"; 226 cerr << "Couldn't read firmware image or malformed image.\n";
227 return false; 227 return false;
228 } 228 }
229 if (!(error = VerifyFirmwareImage(root_key_pub_, image_, 229 if (VERIFY_FIRMWARE_SUCCESS ==
230 0))) // Trusted Mode. 230 (error = VerifyFirmwareImage(root_key_pub_, image_)))
231 return true; 231 return true;
232 cerr << VerifyFirmwareErrorString(error) << "\n"; 232 cerr << VerifyFirmwareErrorString(error) << "\n";
233 return false;; 233 return false;;
234 } 234 }
235 235
236 bool FirmwareUtility::CheckOptions(void) { 236 bool FirmwareUtility::CheckOptions(void) {
237 // Ensure that only one of --{describe|generate|verify} is set. 237 // Ensure that only one of --{describe|generate|verify} is set.
238 if (!((is_describe_ && !is_generate_ && !is_verify_) || 238 if (!((is_describe_ && !is_generate_ && !is_verify_) ||
239 (!is_describe_ && is_generate_ && !is_verify_) || 239 (!is_describe_ && is_generate_ && !is_verify_) ||
240 (!is_describe_ && !is_generate_ && is_verify_))) { 240 (!is_describe_ && !is_generate_ && is_verify_))) {
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
306 } 306 }
307 if (fu.is_verify()) { 307 if (fu.is_verify()) {
308 cerr << "Verification "; 308 cerr << "Verification ";
309 if (fu.VerifySignedImage()) 309 if (fu.VerifySignedImage())
310 cerr << "SUCCESS.\n"; 310 cerr << "SUCCESS.\n";
311 else 311 else
312 cerr << "FAILURE.\n"; 312 cerr << "FAILURE.\n";
313 } 313 }
314 return 0; 314 return 0;
315 } 315 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/utils/firmware_image.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698