From 78517f3a45f8485b8bad9421fd9360fd11e7fe59 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 8 Oct 2015 13:02:19 +0200 Subject: libpayload: Add data structures for hashes in file attributes Taken from cbfstool. Change-Id: I4387900517dbfb1aa51ae6f679e26d0cf5b2acf8 Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/11808 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin --- payloads/libpayload/include/cbfs_core.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'payloads') diff --git a/payloads/libpayload/include/cbfs_core.h b/payloads/libpayload/include/cbfs_core.h index ec59a20d7257..e25a89ed2097 100644 --- a/payloads/libpayload/include/cbfs_core.h +++ b/payloads/libpayload/include/cbfs_core.h @@ -143,6 +143,7 @@ struct cbfs_file { #define CBFS_FILE_ATTR_TAG_UNUSED 0 #define CBFS_FILE_ATTR_TAG_UNUSED2 0xffffffff #define CBFS_FILE_ATTR_TAG_COMPRESSION 0x42435a4c +#define CBFS_FILE_ATTR_TAG_HASH 0x68736148 /* The common fields of extended cbfs file attributes. Attributes are expected to start with tag/len, then append their @@ -162,6 +163,14 @@ struct cbfs_file_attr_compression { uint32_t decompressed_size; } __attribute__((packed)); +struct cbfs_file_attr_hash { + uint32_t tag; + uint32_t len; + uint32_t hash_type; + /* hash_data is len - sizeof(struct) bytes */ + uint8_t hash_data[]; +} __PACKED; + /* Given a cbfs_file, return the first file attribute, or NULL. */ struct cbfs_file_attribute *cbfs_file_first_attr(struct cbfs_file *file); -- cgit v1.2.3