| 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 |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 success = 0; | 163 success = 0; |
| 164 if (!TEST_EQ(VerifyKernelImage(firmware_key, image, DEV_MODE_DISABLED), | 164 if (!TEST_EQ(VerifyKernelImage(firmware_key, image, DEV_MODE_DISABLED), |
| 165 VERIFY_KERNEL_KEY_SIGNATURE_FAILED, | 165 VERIFY_KERNEL_KEY_SIGNATURE_FAILED, |
| 166 "KernelImage Key Signature Tamper Verification (Trusted)")) | 166 "KernelImage Key Signature Tamper Verification (Trusted)")) |
| 167 success = 0; | 167 success = 0; |
| 168 | 168 |
| 169 return success; | 169 return success; |
| 170 } | 170 } |
| 171 | 171 |
| 172 int main(int argc, char* argv[]) { | 172 int main(int argc, char* argv[]) { |
| 173 uint32_t len; | 173 uint64_t len; |
| 174 uint8_t* kernel_sign_key_buf = NULL; | 174 uint8_t* kernel_sign_key_buf = NULL; |
| 175 uint8_t* firmware_key_blob = NULL; | 175 uint8_t* firmware_key_blob = NULL; |
| 176 uint8_t* kernel_blob = NULL; | 176 uint8_t* kernel_blob = NULL; |
| 177 int kernel_blob_len = 0; | 177 int kernel_blob_len = 0; |
| 178 KernelImage* image = NULL; | 178 KernelImage* image = NULL; |
| 179 RSAPublicKey* firmware_key = NULL; | 179 RSAPublicKey* firmware_key = NULL; |
| 180 int error_code = 1; | 180 int error_code = 1; |
| 181 | 181 |
| 182 if(argc != 7) { | 182 if(argc != 7) { |
| 183 fprintf(stderr, "Usage: %s <firmware signing algorithm> " /* argv[1] */ | 183 fprintf(stderr, "Usage: %s <firmware signing algorithm> " /* argv[1] */ |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 | 237 |
| 238 failure: | 238 failure: |
| 239 Free(kernel_blob); | 239 Free(kernel_blob); |
| 240 KernelImageFree(image); | 240 KernelImageFree(image); |
| 241 Free(kernel_sign_key_buf); | 241 Free(kernel_sign_key_buf); |
| 242 Free(firmware_key_blob); | 242 Free(firmware_key_blob); |
| 243 Free(firmware_key); | 243 Free(firmware_key); |
| 244 | 244 |
| 245 return error_code; | 245 return error_code; |
| 246 } | 246 } |
| OLD | NEW |