diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-10-15 13:56:03 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-10-16 02:05:12 +0000 |
commit | 435c74f1ec8a522e41c034cd5fd7a424356dbfb7 (patch) | |
tree | d558ac557d3fd081a42bd3e38233f31c5303a8ac /firmware | |
parent | f2f88042ed3a095819312c57d28e2d93e68d5c37 (diff) | |
download | vboot-435c74f1ec8a522e41c034cd5fd7a424356dbfb7.tar.gz |
vboot2: move firmware hash tags to their own header file
And add a few hash tag types we'll be supporting soon.
No functional changes; just moving an enum from one header to another.
BUG=chromium:423882
BRANCH=none
TEST=VBOOT2=1 make runtests
Change-Id: I6f0fa54ee85fd857c4037856b81e2159e92f1ea9
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223532
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/2lib/include/2api.h | 19 | ||||
-rw-r--r-- | firmware/2lib/include/2fw_hash_tags.h | 40 |
2 files changed, 42 insertions, 17 deletions
diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 4684d54b..b26d1847 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -21,6 +21,7 @@ #define VBOOT_2_API_H_ #include <stdint.h> +#include "2fw_hash_tags.h" #include "2recovery_reasons.h" #include "2return_codes.h" @@ -294,27 +295,11 @@ int vb2api_fw_phase2(struct vb2_context *ctx); */ int vb2api_fw_phase3(struct vb2_context *ctx); -/* - * Tags for types of hashable data. - * - * TODO: These are the ones that vboot specifically knows about given the - * current data structures. In the future, I'd really like the vboot preamble - * to contain an arbitrary list of tags and their hashes, so that we can hash - * ram init, main RW body, EC-RW for software sync, etc. all separately. - */ -enum vb2api_hash_tag { - /* Invalid hash tag; never present in table */ - VB2_HASH_TAG_INVALID = 0, - - /* Firmware body */ - VB2_HASH_TAG_FW_BODY, -}; - /** * Initialize hashing data for the specified tag. * * @param ctx Vboot context - * @param tag Tag to start hashing + * @param tag Tag to start hashing (enum vb2_hash_tag) * @param size If non-null, expected size of data for tag will be * stored here on output. * @return VB2_SUCCESS, or error code on error. diff --git a/firmware/2lib/include/2fw_hash_tags.h b/firmware/2lib/include/2fw_hash_tags.h new file mode 100644 index 00000000..0c061f56 --- /dev/null +++ b/firmware/2lib/include/2fw_hash_tags.h @@ -0,0 +1,40 @@ +/* Copyright (c) 2014 The Chromium OS Authors. All rights reserved. + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + * + * Firmware hash tags for verified boot + */ + +#ifndef VBOOT_REFERENCE_VBOOT_2FW_HASH_TAGS_H_ +#define VBOOT_REFERENCE_VBOOT_2FW_HASH_TAGS_H_ +#include <stdint.h> + +/* + * Tags for types of hashable data. + * + * Note that not every firmware image will contain every tag. + * + * TODO: These are the ones that vboot specifically knows about given the + * current data structures. In the future, I'd really like the vboot preamble + * to contain an arbitrary list of tags and their hashes, so that we can hash + * ram init, main RW body, EC-RW for software sync, etc. all separately. + */ +enum vb2_hash_tag { + /* Invalid hash tag; never present in table */ + VB2_HASH_TAG_INVALID = 0, + + /* Firmware body */ + VB2_HASH_TAG_FW_BODY = 1, + + /* Kernel data key */ + VB2_HASH_TAG_KERNEL_DATA_KEY = 2, + + /* + * Tags over 0x40000000 are reserved for use by the calling firmware, + * which may associate them with arbitrary types of RW firmware data + * that it wants to track. + */ + VB2_HASH_TAG_CALLER_BASE = 0x40000000 +}; + +#endif /* VBOOT_REFERENCE_VBOOT_2FW_HASH_TAGS_H_ */ |