diff options
Diffstat (limited to 'tests/vb2_convert_structs.h')
-rw-r--r-- | tests/vb2_convert_structs.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/vb2_convert_structs.h b/tests/vb2_convert_structs.h index dcf15831..d810c63e 100644 --- a/tests/vb2_convert_structs.h +++ b/tests/vb2_convert_structs.h @@ -25,7 +25,7 @@ static __inline const uint32_t roundup32(uint32_t v) * * @param key Packed key in vboot1 format * @param desc Description of packed key - * @param out_size Size of the newly allocated buffer + * @param out_size Destination for size of the newly allocated buffer * @return a newly allocated buffer with the converted key. Caller is * responsible for freeing this buffer. */ @@ -33,4 +33,24 @@ struct vb2_packed_key2 *vb2_convert_packed_key2( const struct vb2_packed_key *key, const char *desc, uint32_t *out_size); +/** + * Convert a signature from vboot data format to vboot2 data format. + * + * Intended for use by unit tests. Does NOT validate the original struct + * contents, just copies them. + * + * @param sig Signature in vboot1 format + * @param desc Description of signature + * @param key Key to take algorithms and GUID from. If NULL, those + * fields are left uninitialized. + * @param out_size Destination for size of the newly allocated buffer + * @return a newly allocated buffer with the converted signature. Caller is + * responsible for freeing this buffer. + */ +struct vb2_signature2 *vb2_convert_signature2( + const struct vb2_signature *sig, + const char *desc, + const struct vb2_packed_key2 *key, + uint32_t *out_size); + #endif /* VBOOT_REFERENCE_VB2_CONVERT_STRUCTS_H_ */ |