mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
vb20: add vb2api_check_hash_get_digest() for retrieving hash result
For x86 systems, which resume through the boot reset vector, to
implement vboot verification of the memory init code one needs
check that the slot chosen on the resume path is the same as
the original boot path. That check is done by storing the
resulting hash of the slot. However, vb2api doesn't export
the resulting hash from vb2api_check_hash(). Thus, provide
a variant which saves the resulting digest in the supplied
buffer.
BUG=chrome-os-partner:46049
BRANCH=glados
TEST=Suspended and resumed on chell. Also, tested with an EC build
which returns a bad hash to ensure that is properly caught.
Change-Id: Ic20be2024afedabc2d8bc767f1b794376348523c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/323460
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
This commit is contained in:
@@ -496,6 +496,18 @@ int vb2api_extend_hash(struct vb2_context *ctx,
|
||||
*/
|
||||
int vb2api_check_hash(struct vb2_context *ctx);
|
||||
|
||||
/**
|
||||
* Check the hash value started by vb2api_init_hash() while retrieving
|
||||
* calculated digest.
|
||||
*
|
||||
* @param ctx Vboot context
|
||||
* @param digest_out optional pointer to buffer to store digest
|
||||
* @param digest_out_size optional size of buffer to store digest
|
||||
* @return VB2_SUCCESS, or error code on error.
|
||||
*/
|
||||
int vb2api_check_hash_get_digest(struct vb2_context *ctx, void *digest_out,
|
||||
uint32_t digest_out_size);
|
||||
|
||||
/**
|
||||
* Get a PCR digest
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user