summaryrefslogtreecommitdiff
path: root/firmware/lib20/include/vb2_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/lib20/include/vb2_common.h')
-rw-r--r--firmware/lib20/include/vb2_common.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/firmware/lib20/include/vb2_common.h b/firmware/lib20/include/vb2_common.h
index 536fbbb0..96deb51a 100644
--- a/firmware/lib20/include/vb2_common.h
+++ b/firmware/lib20/include/vb2_common.h
@@ -78,7 +78,7 @@ int vb2_verify_packed_key_inside(const void *parent,
const struct vb2_packed_key *key);
/**
- * Unpack a vboot1-format key for use in verification
+ * Unpack a vboot1-format key buffer for use in verification
*
* The elements of the unpacked key will point into the source buffer, so don't
* free the source buffer until you're done with the key.
@@ -88,9 +88,23 @@ int vb2_verify_packed_key_inside(const void *parent,
* @param size Size of buffer in bytes
* @return VB2_SUCCESS, or non-zero error code if error.
*/
+int vb2_unpack_key_buffer(struct vb2_public_key *key,
+ const uint8_t *buf,
+ uint32_t size);
+
+/**
+ * Unpack a vboot1-format key for use in verification
+ *
+ * The elements of the unpacked key will point into the source packed key, so
+ * don't free the source until you're done with the public key.
+ *
+ * @param key Destintion for unpacked key
+ * @param packed_key Source packed key
+ * @param size Size of buffer in bytes
+ * @return VB2_SUCCESS, or non-zero error code if error.
+ */
int vb2_unpack_key(struct vb2_public_key *key,
- const uint8_t *buf,
- uint32_t size);
+ const struct vb2_packed_key *packed_key);
/**
* Verify a signature against an expected hash digest.