| 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 functions for verified boot. | 5 * Host-side functions for verified boot. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef VBOOT_REFERENCE_HOST_SIGNATURE_H_ | 8 #ifndef VBOOT_REFERENCE_HOST_SIGNATURE_H_ |
| 9 #define VBOOT_REFERENCE_HOST_SIGNATURE_H_ | 9 #define VBOOT_REFERENCE_HOST_SIGNATURE_H_ |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 /* Copy a signature key from [src] to [dest]. | 26 /* Copy a signature key from [src] to [dest]. |
| 27 * | 27 * |
| 28 * Returns 0 if success, non-zero if error. */ | 28 * Returns 0 if success, non-zero if error. */ |
| 29 int SignatureCopy(VbSignature* dest, const VbSignature* src); | 29 int SignatureCopy(VbSignature* dest, const VbSignature* src); |
| 30 | 30 |
| 31 | 31 |
| 32 /* Calculates a SHA-512 checksum. | 32 /* Calculates a SHA-512 checksum. |
| 33 * Caller owns the returned pointer, and must free it with Free(). | 33 * Caller owns the returned pointer, and must free it with Free(). |
| 34 * | 34 * |
| 35 * Returns NULL if error. */ | 35 * Returns NULL on error. */ |
| 36 VbSignature* CalculateChecksum(const uint8_t* data, uint64_t size); | 36 VbSignature* CalculateChecksum(const uint8_t* data, uint64_t size); |
| 37 | 37 |
| 38 | 38 |
| 39 /* Calculates a signature for the data using the specified key. | 39 /* Calculates a signature for the data using the specified key. |
| 40 * Caller owns the returned pointer, and must free it with Free(). | 40 * Caller owns the returned pointer, and must free it with Free(). |
| 41 * | 41 * |
| 42 * Returns NULL if error. */ | 42 * Returns NULL on error. */ |
| 43 VbSignature* CalculateSignature(const uint8_t* data, uint64_t size, | 43 VbSignature* CalculateSignature(const uint8_t* data, uint64_t size, |
| 44 const VbPrivateKey* key); | 44 const VbPrivateKey* key); |
| 45 | 45 |
| 46 /* Calculates a signature for the data using the specified key and |
| 47 * an external program. |
| 48 * Caller owns the returned pointer, and must free it with Free(). |
| 49 * |
| 50 * Returns NULL on error. */ |
| 51 VbSignature* CalculateSignature_external(const uint8_t* data, uint64_t size, |
| 52 const char* key_file, |
| 53 uint64_t key_algorithm, |
| 54 const char* external_signer); |
| 55 |
| 46 #endif /* VBOOT_REFERENCE_HOST_SIGNATURE_H_ */ | 56 #endif /* VBOOT_REFERENCE_HOST_SIGNATURE_H_ */ |
| OLD | NEW |