summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2return_codes.h
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 /firmware/2lib/include/2return_codes.h
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 'firmware/2lib/include/2return_codes.h')
-rw-r--r--firmware/2lib/include/2return_codes.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index 27b80d16..d03b0739 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -161,16 +161,16 @@ enum vb2_return_code {
/* Member data outside parent in vb2_verify_member_inside() */
VB2_ERROR_INSIDE_DATA_OUTSIDE,
- /* Unsupported signature algorithm in vb2_unpack_key() */
+ /* Unsupported signature algorithm in vb2_unpack_key_buffer() */
VB2_ERROR_UNPACK_KEY_SIG_ALGORITHM, /* 0x150008 */
- /* Bad key size in vb2_unpack_key() */
+ /* Bad key size in vb2_unpack_key_buffer() */
VB2_ERROR_UNPACK_KEY_SIZE,
- /* Bad key alignment in vb2_unpack_key() */
+ /* Bad key alignment in vb2_unpack_key_buffer() */
VB2_ERROR_UNPACK_KEY_ALIGN,
- /* Bad key array size in vb2_unpack_key() */
+ /* Bad key array size in vb2_unpack_key_buffer() */
VB2_ERROR_UNPACK_KEY_ARRAY_SIZE,
/* Bad algorithm in vb2_verify_data() */
@@ -194,7 +194,7 @@ enum vb2_return_code {
*/
VB2_ERROR_VDATA_DIGEST_SIZE,
- /* Unsupported hash algorithm in vb2_unpack_key() */
+ /* Unsupported hash algorithm in vb2_unpack_key_buffer() */
VB2_ERROR_UNPACK_KEY_HASH_ALGORITHM,
/* Member data overlaps member header */
@@ -256,9 +256,12 @@ enum vb2_return_code {
/* Key algorithm doesn't match signature algorithm */
VB2_ERROR_VDATA_ALGORITHM_MISMATCH,
- /* Bad magic number in vb2_unpack_key() */
+ /* Bad magic number in vb2_unpack_key_buffer() */
VB2_ERROR_UNPACK_KEY_MAGIC,
+ /* Null public key buffer passed to vb2_unpack_key_buffer() */
+ VB2_ERROR_UNPACK_KEY_BUFFER,
+
/**********************************************************************
* Keyblock verification errors (all in vb2_verify_keyblock())
*/