diff options
Diffstat (limited to 'host/lib/include/cbfstool.h')
-rw-r--r-- | host/lib/include/cbfstool.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/host/lib/include/cbfstool.h b/host/lib/include/cbfstool.h index acc6e927..863039ec 100644 --- a/host/lib/include/cbfstool.h +++ b/host/lib/include/cbfstool.h @@ -4,9 +4,34 @@ */ #include "2return_codes.h" +#include "2sha.h" #define ENV_CBFSTOOL "CBFSTOOL" #define DEFAULT_CBFSTOOL "cbfstool" vb2_error_t cbfstool_truncate(const char *file, const char *region, size_t *new_size); + +/* + * Check whether image under `file` path supports CBFS_VERIFICATION, + * and contains metadata hash. Hash found is available under *hash. If it was + * not found, then hash type will be set to VB2_HASH_INVALID. + * + * If `region` is NULL, then region option will not be passed to cbfstool. + * Operations will be performed on default `COREBOOT` region. + */ +vb2_error_t cbfstool_get_metadata_hash(const char *file, const char *region, + struct vb2_hash *hash); + +/* + * Get value of `config` file field. + * + * This function extracts "config" file from selected region, parses it to find + * value of `config_field`, and returns it to `value` as allocated string + * (which has to be freed) or NULL if value was not found. + * + * If `region` is NULL, then region option will not be passed to cbfstool. + * Operations will be performed on default `COREBOOT` region. + */ +vb2_error_t cbfstool_get_config_value(const char *file, const char *region, + const char *config_field, char **value); |