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 firmware image library. | 5 * Tests for firmware 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" | |
12 #include "file_keys.h" | 11 #include "file_keys.h" |
13 #include "firmware_image.h" | 12 #include "firmware_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 Firmware Blob Verification Tests. */ | 17 /* Normal Firmware Blob Verification Tests. */ |
18 void VerifyFirmwareTest(uint8_t* firmware_blob, uint8_t* root_key_blob) { | 18 void VerifyFirmwareTest(uint8_t* firmware_blob, uint8_t* root_key_blob) { |
19 TEST_EQ(VerifyFirmware(root_key_blob, firmware_blob), | 19 TEST_EQ(VerifyFirmware(root_key_blob, firmware_blob), |
20 VERIFY_FIRMWARE_SUCCESS, | 20 VERIFY_FIRMWARE_SUCCESS, |
21 "Normal Firmware Blob Verification"); | 21 "Normal Firmware Blob Verification"); |
22 } | 22 } |
23 | 23 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 | 103 |
104 failure: | 104 failure: |
105 Free(firmware_blob); | 105 Free(firmware_blob); |
106 FirmwareImageFree(image); | 106 FirmwareImageFree(image); |
107 Free(firmware_sign_key_buf); | 107 Free(firmware_sign_key_buf); |
108 Free(root_key_blob); | 108 Free(root_key_blob); |
109 RSAPublicKeyFree(root_key_pub); | 109 RSAPublicKeyFree(root_key_pub); |
110 | 110 |
111 return error_code; | 111 return error_code; |
112 } | 112 } |
OLD | NEW |