| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 fprintf(stderr, "Usage: %s <signing_key_algorithm> <data_key_algorithm>" | 257 fprintf(stderr, "Usage: %s <signing_key_algorithm> <data_key_algorithm>" |
| 258 " <signing key> <processed signing pubkey>" | 258 " <signing key> <processed signing pubkey>" |
| 259 " <data key> <processed data pubkey>\n", argv[0]); | 259 " <data key> <processed data pubkey>\n", argv[0]); |
| 260 return -1; | 260 return -1; |
| 261 } | 261 } |
| 262 | 262 |
| 263 /* Read verification keys and create a test image. */ | 263 /* Read verification keys and create a test image. */ |
| 264 signing_key_algorithm = atoi(argv[1]); | 264 signing_key_algorithm = atoi(argv[1]); |
| 265 data_key_algorithm = atoi(argv[2]); | 265 data_key_algorithm = atoi(argv[2]); |
| 266 | 266 |
| 267 signing_private_key = PrivateKeyRead(argv[3], signing_key_algorithm); | 267 signing_private_key = PrivateKeyReadPem(argv[3], signing_key_algorithm); |
| 268 if (!signing_private_key) { | 268 if (!signing_private_key) { |
| 269 fprintf(stderr, "Error reading signing_private_key"); | 269 fprintf(stderr, "Error reading signing_private_key"); |
| 270 return 1; | 270 return 1; |
| 271 } | 271 } |
| 272 | 272 |
| 273 signing_public_key = PublicKeyReadKeyb(argv[4], signing_key_algorithm, 1); | 273 signing_public_key = PublicKeyReadKeyb(argv[4], signing_key_algorithm, 1); |
| 274 if (!signing_public_key) { | 274 if (!signing_public_key) { |
| 275 fprintf(stderr, "Error reading signing_public_key"); | 275 fprintf(stderr, "Error reading signing_public_key"); |
| 276 return 1; | 276 return 1; |
| 277 } | 277 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 288 | 288 |
| 289 if (signing_public_key) | 289 if (signing_public_key) |
| 290 Free(signing_public_key); | 290 Free(signing_public_key); |
| 291 if (signing_private_key) | 291 if (signing_private_key) |
| 292 Free(signing_private_key); | 292 Free(signing_private_key); |
| 293 if (data_public_key) | 293 if (data_public_key) |
| 294 Free(data_public_key); | 294 Free(data_public_key); |
| 295 | 295 |
| 296 return error_code; | 296 return error_code; |
| 297 } | 297 } |
| OLD | NEW |