summaryrefslogtreecommitdiff
path: root/firmware/2lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/2lib/include')
-rw-r--r--firmware/2lib/include/2common.h10
-rw-r--r--firmware/2lib/include/2return_codes.h17
2 files changed, 27 insertions, 0 deletions
diff --git a/firmware/2lib/include/2common.h b/firmware/2lib/include/2common.h
index a0c82d3c..1ea3f9e2 100644
--- a/firmware/2lib/include/2common.h
+++ b/firmware/2lib/include/2common.h
@@ -184,6 +184,16 @@ int vb2_verify_member_inside(const void *parent, size_t parent_size,
size_t member_data_size);
/**
+ * Return the description of an object starting with a vb2_struct_common header.
+ *
+ * Does not sanity-check the buffer; merely returns the pointer.
+ *
+ * @param buf Pointer to common object
+ * @return A pointer to description or an empty string if none.
+ */
+const char *vb2_common_desc(const void *buf);
+
+/**
* Verify the common struct header is fully contained in its parent data
*
* Also verifies the description is either zero-length or null-terminated.
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index 8f5a5c51..7a59925a 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -600,6 +600,23 @@ enum vb2_return_code {
VB2_SIGN_OBJECT_OVERFLOW,
/**********************************************************************
+ * Errors generated by host library keyblock functions
+ */
+ VB2_ERROR_HOST_KEYBLOCK = VB2_ERROR_HOST_BASE + 0x040000,
+
+ /* Unable to determine signature sizes for vb2_create_keyblock() */
+ VB2_KEYBLOCK_CREATE_SIG_SIZE,
+
+ /* Unable to pack data key for vb2_create_keyblock() */
+ VB2_KEYBLOCK_CREATE_DATA_KEY,
+
+ /* Unable to allocate buffer in vb2_create_keyblock() */
+ VB2_KEYBLOCK_CREATE_ALLOC,
+
+ /* Unable to sign keyblock in vb2_create_keyblock() */
+ VB2_KEYBLOCK_CREATE_SIGN,
+
+ /**********************************************************************
* Highest non-zero error generated inside vboot library. Note that
* error codes passed through vboot when it calls external APIs may
* still be outside this range.