OLD | NEW |
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> |
11 | 11 |
12 #include "file_keys.h" | 12 #include "file_keys.h" |
13 #include "firmware_image.h" | 13 #include "firmware_image.h" |
14 #include "rsa_utility.h" | 14 #include "rsa_utility.h" |
15 #include "test_common.h" | 15 #include "test_common.h" |
16 #include "utility.h" | 16 #include "utility.h" |
17 | 17 |
18 /* Choose a firmware size greater than the range of 32-bits unsigned. */ | 18 /* Choose a firmware size greater than the range of 32-bits unsigned. */ |
19 #define BIG_FIRMWARE_SIZE ((uint64_t) 0x100000000ULL) | 19 #define BIG_FIRMWARE_SIZE UINT64_C(0x100000000) |
20 | 20 |
21 #define ROOT_KEY_BASE_NAME "testkeys/key_rsa8192" | 21 #define ROOT_KEY_BASE_NAME "testkeys/key_rsa8192" |
22 #define FIRMWARE_KEY_BASE_NAME "testkeys/key_rsa1024" | 22 #define FIRMWARE_KEY_BASE_NAME "testkeys/key_rsa1024" |
23 | 23 |
24 const char* kRootKeyPublicFile = ROOT_KEY_BASE_NAME ".keyb"; | 24 const char* kRootKeyPublicFile = ROOT_KEY_BASE_NAME ".keyb"; |
25 const char* kRootKeyFile = ROOT_KEY_BASE_NAME ".pem"; | 25 const char* kRootKeyFile = ROOT_KEY_BASE_NAME ".pem"; |
26 const char* kFirmwareKeyPublicFile = FIRMWARE_KEY_BASE_NAME ".keyb"; | 26 const char* kFirmwareKeyPublicFile = FIRMWARE_KEY_BASE_NAME ".keyb"; |
27 const char* kFirmwareKeyFile = FIRMWARE_KEY_BASE_NAME ".pem"; | 27 const char* kFirmwareKeyFile = FIRMWARE_KEY_BASE_NAME ".pem"; |
28 | 28 |
29 int BigFirmwareTest(void) { | 29 int BigFirmwareTest(void) { |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
OLD | NEW |