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>
This commit is contained in:
Randall Spangler
2014-10-15 13:56:03 -07:00
committed by chrome-internal-fetch
parent f2f88042ed
commit 435c74f1ec
2 changed files with 42 additions and 17 deletions

View File

@@ -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.

View File

@@ -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_ */