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 // Utility for manipulating verified boot kernel images. | 5 // Utility for manipulating verified boot kernel images. |
6 // | 6 // |
7 | 7 |
8 #include "kernel_utility.h" | 8 #include "kernel_utility.h" |
9 | 9 |
10 #include <getopt.h> | 10 #include <getopt.h> |
11 #include <stdio.h> | 11 #include <stdio.h> |
12 #include <stdint.h> // Needed for UINT16_MAX. | 12 #include <stdint.h> // Needed for UINT16_MAX. |
13 #include <stdlib.h> | 13 #include <stdlib.h> |
14 #include <unistd.h> | 14 #include <unistd.h> |
15 | 15 |
16 #include <iostream> | 16 #include <iostream> |
17 | 17 |
18 extern "C" { | 18 extern "C" { |
19 #include "cryptolib.h" | 19 #include "cryptolib.h" |
20 #include "file_keys.h" | 20 #include "file_keys.h" |
21 #include "kernel_image.h" | 21 #include "kernel_image.h" |
22 #include "stateful_util.h" | 22 #include "stateful_util.h" |
| 23 #include "utility.h" |
23 } | 24 } |
24 | 25 |
25 using std::cerr; | 26 using std::cerr; |
26 | 27 |
27 // Macro to determine the size of a field structure in the KernelImage | 28 // Macro to determine the size of a field structure in the KernelImage |
28 // structure. | 29 // structure. |
29 #define FIELD_LEN(field) (sizeof(((KernelImage*)0)->field)) | 30 #define FIELD_LEN(field) (sizeof(((KernelImage*)0)->field)) |
30 | 31 |
31 namespace vboot_reference { | 32 namespace vboot_reference { |
32 | 33 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 } | 516 } |
516 else if (ku.is_verify()) { | 517 else if (ku.is_verify()) { |
517 cerr << "Verification "; | 518 cerr << "Verification "; |
518 if (ku.VerifySignedImage()) | 519 if (ku.VerifySignedImage()) |
519 cerr << "SUCCESS.\n"; | 520 cerr << "SUCCESS.\n"; |
520 else | 521 else |
521 cerr << "FAILURE.\n"; | 522 cerr << "FAILURE.\n"; |
522 } | 523 } |
523 return 0; | 524 return 0; |
524 } | 525 } |
OLD | NEW |