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 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 success = 0; | 153 success = 0; |
154 if (!TEST_EQ(VerifyFirmwareImage(root_key, image, DEV_MODE_DISABLED), | 154 if (!TEST_EQ(VerifyFirmwareImage(root_key, image, DEV_MODE_DISABLED), |
155 VERIFY_FIRMWARE_ROOT_SIGNATURE_FAILED, | 155 VERIFY_FIRMWARE_ROOT_SIGNATURE_FAILED, |
156 "FirmwareImage Root Signature Tamper Verification (Trusted)")) | 156 "FirmwareImage Root Signature Tamper Verification (Trusted)")) |
157 success = 0; | 157 success = 0; |
158 | 158 |
159 return success; | 159 return success; |
160 } | 160 } |
161 | 161 |
162 int main(int argc, char* argv[]) { | 162 int main(int argc, char* argv[]) { |
163 uint32_t len; | 163 uint64_t len; |
164 uint8_t* firmware_sign_key_buf = NULL; | 164 uint8_t* firmware_sign_key_buf = NULL; |
165 uint8_t* root_key_blob = NULL; | 165 uint8_t* root_key_blob = NULL; |
166 uint8_t* firmware_blob = NULL; | 166 uint8_t* firmware_blob = NULL; |
167 int firmware_blob_len = 0; | 167 uint64_t firmware_blob_len = 0; |
168 FirmwareImage* image = NULL; | 168 FirmwareImage* image = NULL; |
169 RSAPublicKey* root_key = NULL; | 169 RSAPublicKey* root_key = NULL; |
170 int error_code = 1; | 170 int error_code = 1; |
171 | 171 |
172 if(argc != 6) { | 172 if(argc != 6) { |
173 fprintf(stderr, "Usage: %s <algorithm> <root key> <processed root pubkey>" | 173 fprintf(stderr, "Usage: %s <algorithm> <root key> <processed root pubkey>" |
174 " <signing key> <processed signing key>\n", argv[0]); | 174 " <signing key> <processed signing key>\n", argv[0]); |
175 return -1; | 175 return -1; |
176 } | 176 } |
177 | 177 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 | 214 |
215 failure: | 215 failure: |
216 Free(firmware_blob); | 216 Free(firmware_blob); |
217 Free(image); | 217 Free(image); |
218 Free(firmware_sign_key_buf); | 218 Free(firmware_sign_key_buf); |
219 Free(root_key_blob); | 219 Free(root_key_blob); |
220 Free(root_key); | 220 Free(root_key); |
221 | 221 |
222 return error_code; | 222 return error_code; |
223 } | 223 } |
OLD | NEW |