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

Side by Side Diff: src/platform/vboot_reference/tests/big_firmware_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 * Tests if firmware image library deals with very large firmware. This 5 * Tests if firmware image library deals with very large firmware. This
6 * is a quick and dirty test for detecting integer overflow issues. 6 * is a quick and dirty test for detecting integer overflow issues.
7 */ 7 */
8 8
9 #include <stdio.h> 9 #include <stdio.h>
10 #include <stdlib.h> 10 #include <stdlib.h>
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 'F'); /* Firmware data fill. */ 45 'F'); /* Firmware data fill. */
46 if (!root_key || !root_key_blob || !firmware_sign_key_buf || !image) { 46 if (!root_key || !root_key_blob || !firmware_sign_key_buf || !image) {
47 error_code = 1; 47 error_code = 1;
48 goto cleanup; 48 goto cleanup;
49 } 49 }
50 debug("Done.\n"); 50 debug("Done.\n");
51 TEST_EQ(VerifyFirmwareImage(root_key, image), 51 TEST_EQ(VerifyFirmwareImage(root_key, image),
52 VERIFY_FIRMWARE_SUCCESS, 52 VERIFY_FIRMWARE_SUCCESS,
53 "Big FirmwareImage Verification"); 53 "Big FirmwareImage Verification");
54 firmware_blob = GetFirmwareBlob(image, &len); 54 firmware_blob = GetFirmwareBlob(image, &len);
55 TEST_EQ(VerifyFirmware(root_key_blob, firmware_blob), 55 TEST_EQ(VerifyFirmware(root_key_blob, image->firmware_data, firmware_blob),
56 VERIFY_FIRMWARE_SUCCESS, 56 VERIFY_FIRMWARE_SUCCESS,
57 "Big Firmware Blob Verification"); 57 "Big Firmware Blob Verification");
58 58
59 cleanup: 59 cleanup:
60 Free(firmware_blob); 60 Free(firmware_blob);
61 FirmwareImageFree(image); 61 FirmwareImageFree(image);
62 Free(firmware_sign_key_buf); 62 Free(firmware_sign_key_buf);
63 RSAPublicKeyFree(root_key); 63 RSAPublicKeyFree(root_key);
64 return error_code; 64 return error_code;
65 } 65 }
66 66
67 int main(int argc, char* argv[1]) 67 int main(int argc, char* argv[1])
68 { 68 {
69 int error_code = 0; 69 int error_code = 0;
70 error_code = BigFirmwareTest(); 70 error_code = BigFirmwareTest();
71 if (!gTestSuccess) 71 if (!gTestSuccess)
72 error_code = 255; 72 error_code = 255;
73 return error_code; 73 return error_code;
74 } 74 }
OLDNEW
« no previous file with comments | « src/platform/vboot_reference/misclibs/file_keys.c ('k') | src/platform/vboot_reference/tests/firmware_image_tests.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698