Chromium Code Reviews| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 77 const RSAPublicKey* key); | 77 const RSAPublicKey* key); |
| 78 | 78 |
| 79 | 79 |
| 80 /* Verifies a secure hash digest from DigestBuf() or DigestFinal(), | 80 /* Verifies a secure hash digest from DigestBuf() or DigestFinal(), |
| 81 * using [key]. */ | 81 * using [key]. */ |
| 82 int VerifyDigest(const uint8_t* digest, const VbSignature *sig, | 82 int VerifyDigest(const uint8_t* digest, const VbSignature *sig, |
| 83 const RSAPublicKey* key); | 83 const RSAPublicKey* key); |
| 84 | 84 |
| 85 | 85 |
| 86 /* Checks the sanity of a key block of size [size] bytes, using public | 86 /* Checks the sanity of a key block of size [size] bytes, using public |
| 87 * key [key]. If [key]==NULL, uses only the block checksum to verify | 87 * key [key]. If hash_only, uses only the block checksum to verify |
|
gauravsh
2010/08/17 22:24:13
If hash_only is non-zero
Randall Spangler
2010/08/17 22:43:55
Done.
| |
| 88 * the key block. Header fields are also checked for sanity. Does not | 88 * the key block. Header fields are also checked for sanity. Does not |
| 89 * verify key index or key block flags. */ | 89 * verify key index or key block flags. */ |
| 90 int KeyBlockVerify(const VbKeyBlockHeader* block, uint64_t size, | 90 int KeyBlockVerify(const VbKeyBlockHeader* block, uint64_t size, |
| 91 const VbPublicKey *key); | 91 const VbPublicKey *key, int hash_only); |
| 92 | 92 |
| 93 | 93 |
| 94 /* Checks the sanity of a firmware preamble of size [size] bytes, | 94 /* Checks the sanity of a firmware preamble of size [size] bytes, |
| 95 * using public key [key]. | 95 * using public key [key]. |
| 96 * | 96 * |
| 97 * Returns VBOOT_SUCCESS if successful. */ | 97 * Returns VBOOT_SUCCESS if successful. */ |
| 98 int VerifyFirmwarePreamble(const VbFirmwarePreambleHeader* preamble, | 98 int VerifyFirmwarePreamble(const VbFirmwarePreambleHeader* preamble, |
| 99 uint64_t size, const RSAPublicKey* key); | 99 uint64_t size, const RSAPublicKey* key); |
| 100 | 100 |
| 101 | 101 |
| 102 /* Checks the sanity of a kernel preamble of size [size] bytes, | 102 /* Checks the sanity of a kernel preamble of size [size] bytes, |
| 103 * using public key [key]. | 103 * using public key [key]. |
| 104 * | 104 * |
| 105 * Returns VBOOT_SUCCESS if successful. */ | 105 * Returns VBOOT_SUCCESS if successful. */ |
| 106 int VerifyKernelPreamble(const VbKernelPreambleHeader* preamble, | 106 int VerifyKernelPreamble(const VbKernelPreambleHeader* preamble, |
| 107 uint64_t size, const RSAPublicKey* key); | 107 uint64_t size, const RSAPublicKey* key); |
| 108 | 108 |
| 109 | 109 |
| 110 | 110 |
| 111 | 111 |
| 112 #endif /* VBOOT_REFERENCE_VBOOT_COMMON_H_ */ | 112 #endif /* VBOOT_REFERENCE_VBOOT_COMMON_H_ */ |
| OLD | NEW |