| 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 "kernel_image.h" | 13 #include "kernel_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 kernel size greater than the range of 32-bits unsigned. */ | 18 /* Choose a kernel size greater than the range of 32-bits unsigned. */ |
| 19 #define BIG_KERNEL_SIZE ((uint64_t) 0x100000000) | 19 #define BIG_KERNEL_SIZE ((uint64_t) 0x100000000ULL) |
| 20 | 20 |
| 21 #define FIRMWARE_KEY_BASE_NAME "testkeys/key_rsa2048" | 21 #define FIRMWARE_KEY_BASE_NAME "testkeys/key_rsa2048" |
| 22 #define KERNEL_KEY_BASE_NAME "testkeys/key_rsa1024" | 22 #define KERNEL_KEY_BASE_NAME "testkeys/key_rsa1024" |
| 23 | 23 |
| 24 const char* kFirmwareKeyPublicFile = FIRMWARE_KEY_BASE_NAME ".keyb"; | 24 const char* kFirmwareKeyPublicFile = FIRMWARE_KEY_BASE_NAME ".keyb"; |
| 25 const char* kFirmwareKeyFile = FIRMWARE_KEY_BASE_NAME ".pem"; | 25 const char* kFirmwareKeyFile = FIRMWARE_KEY_BASE_NAME ".pem"; |
| 26 const char* kKernelKeyPublicFile = KERNEL_KEY_BASE_NAME ".keyb"; | 26 const char* kKernelKeyPublicFile = KERNEL_KEY_BASE_NAME ".keyb"; |
| 27 const char* kKernelKeyFile = KERNEL_KEY_BASE_NAME ".pem"; | 27 const char* kKernelKeyFile = KERNEL_KEY_BASE_NAME ".pem"; |
| 28 | 28 |
| 29 int BigKernelTest() { | 29 int BigKernelTest() { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 } | 67 } |
| 68 | 68 |
| 69 int main(int argc, char* argv[1]) | 69 int main(int argc, char* argv[1]) |
| 70 { | 70 { |
| 71 int error_code = 0; | 71 int error_code = 0; |
| 72 error_code = BigKernelTest(); | 72 error_code = BigKernelTest(); |
| 73 if (!gTestSuccess) | 73 if (!gTestSuccess) |
| 74 error_code = 255; | 74 error_code = 255; |
| 75 return error_code; | 75 return error_code; |
| 76 } | 76 } |
| OLD | NEW |