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

Side by Side Diff: src/platform/vboot_reference/tests/firmware_splicing_tests.c

Issue 1578035: Change VerifyFirmware() to take separate pointers to firmware verification header and firmware data. (Closed)
Patch Set: review fixes 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
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 * Splicing tests for the firmware image verification library. 5 * Splicing tests for the firmware image verification library.
6 */ 6 */
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <stdlib.h> 9 #include <stdlib.h>
10 10
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 * and put it into [image2]. */ 60 * and put it into [image2]. */
61 Memcpy(image2->firmware_signature, image1->firmware_signature, 61 Memcpy(image2->firmware_signature, image1->firmware_signature,
62 siglen_map[0]); 62 siglen_map[0]);
63 Memcpy(image2->firmware_data, image1->firmware_data, 63 Memcpy(image2->firmware_data, image1->firmware_data,
64 image2->firmware_len); 64 image2->firmware_len);
65 65
66 TEST_EQ(VerifyFirmwareImage(root_key, image2), 66 TEST_EQ(VerifyFirmwareImage(root_key, image2),
67 VERIFY_FIRMWARE_SIGNATURE_FAILED, 67 VERIFY_FIRMWARE_SIGNATURE_FAILED,
68 "FirmwareImage firmware_data Splicing"); 68 "FirmwareImage firmware_data Splicing");
69 firmware_blob = GetFirmwareBlob(image2, &len); 69 firmware_blob = GetFirmwareBlob(image2, &len);
70 TEST_EQ(VerifyFirmware(root_key_blob, firmware_blob), 70 TEST_EQ(VerifyFirmware(root_key_blob, firmware_blob, image2->firmware_data),
71 VERIFY_FIRMWARE_SIGNATURE_FAILED, 71 VERIFY_FIRMWARE_SIGNATURE_FAILED,
72 "Firmware Blob firmware_data Splicing"); 72 "Firmware Blob firmware_data Splicing");
73 } 73 }
74 74
75 int main(int argc, char* argv[]) 75 int main(int argc, char* argv[])
76 { 76 {
77 int error_code = 0; 77 int error_code = 0;
78 VerifyFirmwareSplicingTest(); 78 VerifyFirmwareSplicingTest();
79 if (!gTestSuccess) 79 if (!gTestSuccess)
80 error_code = 255; 80 error_code = 255;
81 return error_code; 81 return error_code;
82 } 82 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698