summaryrefslogtreecommitdiff
path: root/futility/cmd_vbutil_firmware.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2016-10-18 15:09:21 -0700
committerRandall Spangler <rspangler@chromium.org>2016-11-06 02:34:03 +0000
commit6e3931d1f609fc23b3ca8c7f6e563926e4f38b69 (patch)
treea026366a822ad7300b2b76a14c8e5df77305e564 /futility/cmd_vbutil_firmware.c
parent559a110f33b7ebe8d950f1c2de6b3b89791f862b (diff)
downloadvboot-6e3931d1f609fc23b3ca8c7f6e563926e4f38b69.tar.gz
vboot: Add vb2_unpack_key_buffer
Previously, vb2_unpack_key() actually unpacked a key buffer. Callers that had a vb2_packed_key had to typecast it back to a uint8_t buffer to unpack it. Rename vb2_unpack_key() to vb2_unpack_key_buffer(), and make vb2_unpack_key() unpack a vb2_packed_key. BUG=chromium:611535 BRANCH=none TEST=make runtests; emerge-kevin coreboot depthcharge; emerge-samus and boot it Change-Id: I9ee38a819c59cc58a72ead78cf5ddf3d0f301ae7 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/400906 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'futility/cmd_vbutil_firmware.c')
-rw-r--r--futility/cmd_vbutil_firmware.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/futility/cmd_vbutil_firmware.c b/futility/cmd_vbutil_firmware.c
index 3bf3492b..ef1148ed 100644
--- a/futility/cmd_vbutil_firmware.c
+++ b/futility/cmd_vbutil_firmware.c
@@ -211,7 +211,7 @@ static int do_verify(const char *infile, const char *signpubkey,
fprintf(stderr, "Error reading signpubkey.\n");
goto verify_cleanup;
}
- if (VB2_SUCCESS != vb2_unpack_key(&sign_key, pubkbuf, pubklen)) {
+ if (VB2_SUCCESS != vb2_unpack_key_buffer(&sign_key, pubkbuf, pubklen)) {
fprintf(stderr, "Error unpacking signpubkey.\n");
goto verify_cleanup;
}
@@ -254,9 +254,7 @@ static int do_verify(const char *infile, const char *signpubkey,
struct vb2_public_key data_key;
if (VB2_SUCCESS !=
- vb2_unpack_key(&data_key, (const uint8_t *)&keyblock->data_key,
- keyblock->data_key.key_offset +
- keyblock->data_key.key_size)) {
+ vb2_unpack_key(&data_key, &keyblock->data_key)) {
fprintf(stderr, "Error parsing data key.\n");
goto verify_cleanup;
}