mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
vboot2: Introduce vb2ex_hwcrypto API
This patch extends the vboot2 API by three callback functions that the platform firmware may implement to offer hardware crypto engine support. For now we only support this for hash algorithms, and we will only allow it for firmware body hashes (not the keyblock or preamble which are too small to matter execution-time-wise anyway). The API is similar to the vb2api_*_hash() functions used to start body hashing in the first place, but we still take this round trip through vboot to allow it to do key/signature management and retain full control of the verification process. We also add a new preamble flag to explicitly disable this feature, so that we can later return to a solely software-based verification path through a firmware update in case a hardware crypto engine turns out to be insecure. CQ-DEPEND=CL:236435 BRANCH=None BUG=chrome-os-partner:32987 TEST='make runtests VBOOT2=1'. Manually booted on Pinky with and without HW crypto support and with the preamble flag set to confirm expected behavior. lib21/ parts untested except for compiling and new unit tests. Change-Id: I17c7d02f392089875a5942a5aafcf6a657354863 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/236453 Reviewed-by: Randall Spangler <rspangler@chromium.org>
This commit is contained in:
committed by
ChromeOS Commit Bot
parent
f47eccf65b
commit
f10e909928
@@ -291,6 +291,12 @@ struct vb2_keyblock {
|
||||
#define VB2_FW_PREAMBLE_VERSION_MAJOR 3
|
||||
#define VB2_FW_PREAMBLE_VERSION_MINOR 0
|
||||
|
||||
/* Flags for vb2_fw_preamble.flags */
|
||||
/* Reserved; do not use */
|
||||
#define VB2_FIRMWARE_PREAMBLE_RESERVED0 0x00000001
|
||||
/* Do not allow use of any hardware crypto accelerators. */
|
||||
#define VB2_FIRMWARE_PREAMBLE_DISALLOW_HWCRYPTO 0x00000002
|
||||
|
||||
/*
|
||||
* Firmware preamble
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user