summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2sha.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2014-12-16 19:24:54 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-01-06 23:43:30 +0000
commitf10e9099286202f83ce4c1dc5ef1e85fcb5ccde7 (patch)
tree7346b671a9f427c6e7dd0b7a8cdb10b41e1db9e6 /firmware/2lib/include/2sha.h
parentf47eccf65b05ebab7f3f24c14a09aceb442e08fc (diff)
downloadvboot-f10e9099286202f83ce4c1dc5ef1e85fcb5ccde7.tar.gz
vboot2: Introduce vb2ex_hwcrypto APIstabilize-storm-6683.Bstabilize-6670.Bstabilize-6662.B
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>
Diffstat (limited to 'firmware/2lib/include/2sha.h')
-rw-r--r--firmware/2lib/include/2sha.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/2lib/include/2sha.h b/firmware/2lib/include/2sha.h
index 58792369..221d1856 100644
--- a/firmware/2lib/include/2sha.h
+++ b/firmware/2lib/include/2sha.h
@@ -78,6 +78,9 @@ struct vb2_digest_context {
/* Current hash algorithm */
enum vb2_hash_algorithm hash_alg;
+
+ /* 1 if digest is computed with vb2ex_hwcrypto routines, else 0 */
+ int using_hwcrypto;
};
/**