Julius Werner | fdabf3f | 2020-05-06 17:06:35 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
| 3 | |
| 4 | #ifndef _METADATA_HASH_H_ |
| 5 | #define _METADATA_HASH_H_ |
| 6 | |
| 7 | #include <commonlib/bsd/metadata_hash.h> |
| 8 | |
| 9 | /* Verify the an FMAP data structure with the FMAP hash that is stored together with the CBFS |
| 10 | metadata hash in the bootblock's metadata hash anchor (when CBFS verification is enabled). */ |
| 11 | vb2_error_t metadata_hash_verify_fmap(const void *fmap_base, size_t fmap_size); |
| 12 | |
| 13 | #if CONFIG(CBFS_VERIFICATION) |
| 14 | /* Get the (RO) CBFS metadata hash for this CBFS image, which forms the root of trust for CBFS |
| 15 | verification. This function is only available in the bootblock. */ |
| 16 | struct vb2_hash *metadata_hash_get(void); |
| 17 | #else |
| 18 | static inline struct vb2_hash *metadata_hash_get(void) { return NULL; } |
| 19 | #endif |
| 20 | |
| 21 | #endif |