summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangheui Won <khwon@chromium.org>2020-11-27 16:00:06 +1100
committerCommit Bot <commit-bot@chromium.org>2020-12-09 12:01:41 +0000
commit3425315e87738b80c9efc15801d491545b38146b (patch)
treee2ac91f886f53c5d6ee80533aeba4bda143dc54a
parent1009be350708b0782fa875c0f4b165dcd8f9ba0b (diff)
downloadvboot-3425315e87738b80c9efc15801d491545b38146b.tar.gz
vboot2: remove rsa from vb2_hwcrypto_rsa_allowed
Initially vb2_hwcrypto_rsa_allowed were meant to only determine if we can use rsa hardware acceleration. However we're planning to also use this method for hashing, hence drop rsa from the name. BUG=b:166038345 BRANCH=zork TEST=CC=x86_64-pc-linux-gnu-clang make runtests Signed-off-by: Kangheui Won <khwon@chromium.org> Change-Id: I9efb05b3d035dcd584a47d006415ea87bf931ad6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2566865 Reviewed-by: Joel Kitching <kitching@chromium.org>
-rw-r--r--firmware/2lib/2api.c2
-rw-r--r--firmware/2lib/include/2secdata.h5
-rw-r--r--firmware/lib20/misc.c4
3 files changed, 6 insertions, 5 deletions
diff --git a/firmware/2lib/2api.c b/firmware/2lib/2api.c
index 95dc6c2d..28de8348 100644
--- a/firmware/2lib/2api.c
+++ b/firmware/2lib/2api.c
@@ -355,7 +355,7 @@ vb2_error_t vb2api_check_hash_get_digest(struct vb2_context *ctx,
vb2_member_of(sd, sd->data_key_offset),
sd->data_key_size));
- key.allow_hwcrypto = vb2_hwcrypto_rsa_allowed(ctx);
+ key.allow_hwcrypto = vb2_hwcrypto_allowed(ctx);
/*
* Check digest vs. signature. Note that this destroys the signature.
diff --git a/firmware/2lib/include/2secdata.h b/firmware/2lib/include/2secdata.h
index 880a2ec3..c3355f8c 100644
--- a/firmware/2lib/include/2secdata.h
+++ b/firmware/2lib/include/2secdata.h
@@ -217,9 +217,10 @@ int vb2_secdata_fwmp_get_flag(struct vb2_context *ctx,
uint8_t *vb2_secdata_fwmp_get_dev_key_hash(struct vb2_context *ctx);
/*
- * Helper function to check if hwcrypto for RSA is allowed
+ * Helper function to check if hwcrypto is allowed.
*/
-static inline int vb2_hwcrypto_rsa_allowed(struct vb2_context *ctx) {
+static inline int vb2_hwcrypto_allowed(struct vb2_context *ctx)
+{
/* disable hwcrypto in recovery mode */
if (ctx->flags & VB2_CONTEXT_RECOVERY_MODE)
diff --git a/firmware/lib20/misc.c b/firmware/lib20/misc.c
index 6ad3cab4..bc8e9955 100644
--- a/firmware/lib20/misc.c
+++ b/firmware/lib20/misc.c
@@ -43,7 +43,7 @@ vb2_error_t vb2_load_fw_keyblock(struct vb2_context *ctx)
/* Unpack the root key */
VB2_TRY(vb2_unpack_key_buffer(&root_key, key_data, key_size));
- root_key.allow_hwcrypto = vb2_hwcrypto_rsa_allowed(ctx);
+ root_key.allow_hwcrypto = vb2_hwcrypto_allowed(ctx);
/* Load the firmware keyblock header after the root key */
kb = vb2_workbuf_alloc(&wb, sizeof(*kb));
@@ -149,7 +149,7 @@ vb2_error_t vb2_load_fw_preamble(struct vb2_context *ctx)
VB2_TRY(vb2_unpack_key_buffer(&data_key, key_data, key_size));
- data_key.allow_hwcrypto = vb2_hwcrypto_rsa_allowed(ctx);
+ data_key.allow_hwcrypto = vb2_hwcrypto_allowed(ctx);
/* Load the firmware preamble header */
pre = vb2_workbuf_alloc(&wb, sizeof(*pre));