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 * Host-side misc functions for verified boot. | 5 * Host-side misc functions for verified boot. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef VBOOT_REFERENCE_HOST_MISC_H_ | 8 #ifndef VBOOT_REFERENCE_HOST_MISC_H_ |
9 #define VBOOT_REFERENCE_HOST_MISC_H_ | 9 #define VBOOT_REFERENCE_HOST_MISC_H_ |
10 | 10 |
11 #include "utility.h" | 11 #include "utility.h" |
12 #include "vboot_struct.h" | 12 #include "vboot_struct.h" |
13 | 13 |
14 | 14 |
15 /* Read data from [filename]. Store the size of returned data in [size]. | 15 /* Read data from [filename]. Store the size of returned data in [size]. |
16 * | 16 * |
17 * Returns the data buffer, which the caller must Free(), or NULL if | 17 * Returns the data buffer, which the caller must Free(), or NULL if |
18 * error. */ | 18 * error. */ |
19 uint8_t* ReadFile(const char* filename, uint64_t* size); | 19 uint8_t* ReadFile(const char* filename, uint64_t* size); |
20 | 20 |
21 | 21 |
22 /* Writes [size] bytes of [data] to [filename]. | 22 /* Writes [size] bytes of [data] to [filename]. |
23 * | 23 * |
24 * Returns 0 if success, 1 if error. */ | 24 * Returns 0 if success, 1 if error. */ |
25 int WriteFile(const char* filename, const void *data, uint64_t size); | 25 int WriteFile(const char* filename, const void *data, uint64_t size); |
26 | 26 |
| 27 /* Prints the sha1sum of the given VbPublicKey to stdout. */ |
| 28 void PrintPubKeySha1Sum(VbPublicKey* key); |
27 | 29 |
28 #endif /* VBOOT_REFERENCE_HOST_MISC_H_ */ | 30 #endif /* VBOOT_REFERENCE_HOST_MISC_H_ */ |
OLD | NEW |