vboot2: Add host library functions to read/write new-format key objects

And unit tests for them.

BUG=chromium:423882
BRANCH=none
TEST=make runtests && VBOOT2=1 make runtests

Change-Id: I720bfb2537bae60f05b5ce28ab196a331a82eedf
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/230931
This commit is contained in:
Randall Spangler
2014-11-17 14:24:59 -08:00
committed by chrome-internal-fetch
parent 02e11b323b
commit 59c29202d2
8 changed files with 996 additions and 28 deletions

View File

@@ -288,6 +288,20 @@ int vb2_unpack_key2(struct vb2_public_key *key,
const uint8_t *buf,
uint32_t size);
/**
* Unpack the RSA data fields for a public key
*
* This is called by vb2_unpack_key2() to extract the arrays from a packed key.
* These elements of *key will point inside the key_data buffer.
*
* @param key Destination key for RSA data fields
* @param key_data Packed key data (from inside a packed key buffer)
* @param key_size Size of packed key data in bytes
*/
int vb2_unpack_key2_data(struct vb2_public_key *key,
const uint8_t *key_data,
uint32_t key_size);
/**
* Return expected signature size for a signature/hash algorithm pair
*