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 for kernel image library. | 5 * Tests for kernel image library. |
6 */ | 6 */ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 #include <stdlib.h> | 9 #include <stdlib.h> |
10 | 10 |
| 11 #include "cryptolib.h" |
11 #include "file_keys.h" | 12 #include "file_keys.h" |
12 #include "kernel_image.h" | 13 #include "kernel_image.h" |
13 #include "rsa_utility.h" | |
14 #include "test_common.h" | 14 #include "test_common.h" |
15 #include "utility.h" | 15 #include "utility.h" |
16 | 16 |
17 /* Normal Kernel Blob Verification Tests. */ | 17 /* Normal Kernel Blob Verification Tests. */ |
18 void VerifyKernelTest(uint8_t* kernel_blob, uint8_t* firmware_key_blob) { | 18 void VerifyKernelTest(uint8_t* kernel_blob, uint8_t* firmware_key_blob) { |
19 TEST_EQ(VerifyKernel(firmware_key_blob, kernel_blob, DEV_MODE_ENABLED), | 19 TEST_EQ(VerifyKernel(firmware_key_blob, kernel_blob, DEV_MODE_ENABLED), |
20 VERIFY_KERNEL_SUCCESS, | 20 VERIFY_KERNEL_SUCCESS, |
21 "Normal Kernel Blob Verification (Dev Mode)"); | 21 "Normal Kernel Blob Verification (Dev Mode)"); |
22 | 22 |
23 TEST_EQ(VerifyKernel(firmware_key_blob, kernel_blob, DEV_MODE_DISABLED), | 23 TEST_EQ(VerifyKernel(firmware_key_blob, kernel_blob, DEV_MODE_DISABLED), |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 | 131 |
132 failure: | 132 failure: |
133 Free(kernel_blob); | 133 Free(kernel_blob); |
134 KernelImageFree(image); | 134 KernelImageFree(image); |
135 Free(kernel_sign_key_buf); | 135 Free(kernel_sign_key_buf); |
136 Free(firmware_key_blob); | 136 Free(firmware_key_blob); |
137 RSAPublicKeyFree(firmware_key); | 137 RSAPublicKeyFree(firmware_key); |
138 | 138 |
139 return error_code; | 139 return error_code; |
140 } | 140 } |
OLD | NEW |