| 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 * Common functions between firmware and kernel verified boot. | 5 * Common functions between firmware and kernel verified boot. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #ifndef VBOOT_REFERENCE_VBOOT_COMMON_H_ | 8 #ifndef VBOOT_REFERENCE_VBOOT_COMMON_H_ |
| 9 #define VBOOT_REFERENCE_VBOOT_COMMON_H_ | 9 #define VBOOT_REFERENCE_VBOOT_COMMON_H_ |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 * | 60 * |
| 61 * Returns NULL if error. */ | 61 * Returns NULL if error. */ |
| 62 RSAPublicKey* PublicKeyToRSA(const VbPublicKey* key); | 62 RSAPublicKey* PublicKeyToRSA(const VbPublicKey* key); |
| 63 | 63 |
| 64 | 64 |
| 65 /* Verifies [data] matches signature [sig] using [key]. */ | 65 /* Verifies [data] matches signature [sig] using [key]. */ |
| 66 int VerifyData(const uint8_t* data, const VbSignature* sig, | 66 int VerifyData(const uint8_t* data, const VbSignature* sig, |
| 67 const RSAPublicKey* key); | 67 const RSAPublicKey* key); |
| 68 | 68 |
| 69 | 69 |
| 70 /* Verifies a secure hash digest from DigestBuf() or DigestFinal(), |
| 71 * using [key]. */ |
| 72 int VerifyDigest(const uint8_t* digest, const VbSignature *sig, |
| 73 const RSAPublicKey* key); |
| 74 |
| 75 |
| 70 /* Checks the sanity of a key block of size [size] bytes, using public | 76 /* Checks the sanity of a key block of size [size] bytes, using public |
| 71 * key [key]. If [key]==NULL, uses only the block checksum to verify | 77 * key [key]. If [key]==NULL, uses only the block checksum to verify |
| 72 * the key block. Header fields are also checked for sanity. Does not | 78 * the key block. Header fields are also checked for sanity. Does not |
| 73 * verify key index or key block flags. */ | 79 * verify key index or key block flags. */ |
| 74 int KeyBlockVerify(const VbKeyBlockHeader* block, uint64_t size, | 80 int KeyBlockVerify(const VbKeyBlockHeader* block, uint64_t size, |
| 75 const VbPublicKey *key); | 81 const VbPublicKey *key); |
| 76 | 82 |
| 77 | 83 |
| 78 /* Checks the sanity of a firmware preamble of size [size] bytes, | 84 /* Checks the sanity of a firmware preamble of size [size] bytes, |
| 79 * using public key [key]. | 85 * using public key [key]. |
| 80 * | 86 * |
| 81 * Returns VBOOT_SUCCESS if successful. */ | 87 * Returns VBOOT_SUCCESS if successful. */ |
| 82 int VerifyFirmwarePreamble2(const VbFirmwarePreambleHeader* preamble, | 88 int VerifyFirmwarePreamble2(const VbFirmwarePreambleHeader* preamble, |
| 83 uint64_t size, const RSAPublicKey* key); | 89 uint64_t size, const RSAPublicKey* key); |
| 84 | 90 |
| 85 | 91 |
| 86 /* Checks the sanity of a kernel preamble of size [size] bytes, | 92 /* Checks the sanity of a kernel preamble of size [size] bytes, |
| 87 * using public key [key]. | 93 * using public key [key]. |
| 88 * | 94 * |
| 89 * Returns VBOOT_SUCCESS if successful. */ | 95 * Returns VBOOT_SUCCESS if successful. */ |
| 90 int VerifyKernelPreamble2(const VbKernelPreambleHeader* preamble, | 96 int VerifyKernelPreamble2(const VbKernelPreambleHeader* preamble, |
| 91 uint64_t size, const RSAPublicKey* key); | 97 uint64_t size, const RSAPublicKey* key); |
| 92 | 98 |
| 93 | 99 |
| 94 | 100 |
| 95 | 101 |
| 96 #endif /* VBOOT_REFERENCE_VBOOT_COMMON_H_ */ | 102 #endif /* VBOOT_REFERENCE_VBOOT_COMMON_H_ */ |
| OLD | NEW |