summaryrefslogtreecommitdiff
path: root/firmware/2lib/2api.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-10-23 10:07:54 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-10-28 03:13:07 +0000
commit4eef812d68f64cc501d795131d95f8a2f27223b1 (patch)
treeb591b4b70608e2bb048726c6c0e589937777c8ee /firmware/2lib/2api.c
parent9e39efd6474449ec38bb2bcc2209a070fb6e6937 (diff)
downloadvboot-4eef812d68f64cc501d795131d95f8a2f27223b1.tar.gz
vboot2: use enum hash algorithmstabilize-6412.B
This changes the internals of vboot2 to use the enumerated type for hash algorithm. The conversion from crypto algorithm is done only when unpacking the key (and ok, in checking the rsa padding, but that goes away in the next change). This is preparation for the vboot2 data types, which separate signature and hash algorithms into their own fields. There is no external change in the calling API to vboot, and no change to the external data structures. BUG=chromium:423882 BRANCH=none TEST=VBOOT2=1 make runtests Change-Id: I9c6de08d742dab941beb806fbd2bfc1e11c01e2c Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/225208 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'firmware/2lib/2api.c')
-rw-r--r--firmware/2lib/2api.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/2lib/2api.c b/firmware/2lib/2api.c
index 8948093b..1f128a49 100644
--- a/firmware/2lib/2api.c
+++ b/firmware/2lib/2api.c
@@ -190,7 +190,7 @@ int vb2api_init_hash(struct vb2_context *ctx, uint32_t tag, uint32_t *size)
if (size)
*size = pre->body_signature.data_size;
- return vb2_digest_init(dc, key.algorithm);
+ return vb2_digest_init(dc, key.hash_alg);
}
int vb2api_extend_hash(struct vb2_context *ctx,
@@ -222,7 +222,7 @@ int vb2api_check_hash(struct vb2_context *ctx)
struct vb2_workbuf wb;
uint8_t *digest;
- uint32_t digest_size = vb2_digest_size(dc->algorithm);
+ uint32_t digest_size = vb2_digest_size(dc->hash_alg);
struct vb2_fw_preamble *pre;
struct vb2_public_key key;