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

Side by Side Diff: src/platform/vboot_reference/vfirmware/firmware_image_fw.c

Issue 1665007: Fix bug in GetLogicalFirmwareVersion(). (Closed)
Patch Set: Created 10 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
« no previous file with comments | « no previous file | 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 * Functions for verifying a verified boot firmware image. 5 * Functions for verifying a verified boot firmware image.
6 * (Firmware Portion) 6 * (Firmware Portion)
7 */ 7 */
8 8
9 #include "firmware_image_fw.h" 9 #include "firmware_image_fw.h"
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 verification_header_blob + (FIELD_LEN(magic) + /* Offset to field. */ 223 verification_header_blob + (FIELD_LEN(magic) + /* Offset to field. */
224 FIELD_LEN(header_len) + 224 FIELD_LEN(header_len) +
225 FIELD_LEN(firmware_sign_algorithm)), 225 FIELD_LEN(firmware_sign_algorithm)),
226 sizeof(firmware_key_version)); 226 sizeof(firmware_key_version));
227 if (firmware_sign_algorithm >= kNumAlgorithms) 227 if (firmware_sign_algorithm >= kNumAlgorithms)
228 return 0; 228 return 0;
229 firmware_sign_key_len = RSAProcessedKeySize(firmware_sign_algorithm); 229 firmware_sign_key_len = RSAProcessedKeySize(firmware_sign_algorithm);
230 Memcpy(&firmware_version, 230 Memcpy(&firmware_version,
231 verification_header_blob + (FIELD_LEN(magic) + /* Offset to field. */ 231 verification_header_blob + (FIELD_LEN(magic) + /* Offset to field. */
232 FIELD_LEN(header_len) + 232 FIELD_LEN(header_len) +
233 FIELD_LEN(firmware_sign_algorithm) +
233 FIELD_LEN(firmware_key_version) + 234 FIELD_LEN(firmware_key_version) +
234 firmware_sign_key_len + 235 firmware_sign_key_len +
235 FIELD_LEN(header_checksum) + 236 FIELD_LEN(header_checksum) +
236 FIELD_LEN(firmware_key_signature)), 237 FIELD_LEN(firmware_key_signature)),
237 sizeof(firmware_version)); 238 sizeof(firmware_version));
238 return CombineUint16Pair(firmware_key_version, firmware_version); 239 return CombineUint16Pair(firmware_key_version, firmware_version);
239 } 240 }
240 241
241 int VerifyFirmwareDriver_f(uint8_t* root_key_blob, 242 int VerifyFirmwareDriver_f(uint8_t* root_key_blob,
242 uint8_t* verification_headerA, 243 uint8_t* verification_headerA,
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 */ 322 */
322 if (stored_lversion <= firmwareB_lversion && 323 if (stored_lversion <= firmwareB_lversion &&
323 (VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob, 324 (VERIFY_FIRMWARE_SUCCESS == VerifyFirmware(root_key_blob,
324 verification_headerB, 325 verification_headerB,
325 firmwareB))) 326 firmwareB)))
326 return BOOT_FIRMWARE_B_CONTINUE; 327 return BOOT_FIRMWARE_B_CONTINUE;
327 } 328 }
328 /* D'oh: No bootable firmware. */ 329 /* D'oh: No bootable firmware. */
329 return BOOT_FIRMWARE_RECOVERY_CONTINUE; 330 return BOOT_FIRMWARE_RECOVERY_CONTINUE;
330 } 331 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698