vboot2: Add vb2_unpack_key2() and unit tests

This unpacks new-style packed keys.

For now, it can also handle old-style packed keys by passing them to
the old unpacking function.  Once we've switched over to new-style
keys in the signing scripts, we'll remove the old format to save code
size.

Also added is a test library which converts from old to new struct
formats.  That should eventually get absorbed into futility, and the
test keys directory should have both old and new format packed keys in
it.

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

Change-Id: I0fe31f124781d1ea1efedab65dcd6130bfca18dd
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225490
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
Randall Spangler
2014-10-23 17:38:18 -07:00
committed by chrome-internal-fetch
parent f6cfb974ce
commit d274a2e953
10 changed files with 341 additions and 3 deletions

View File

@@ -19,6 +19,9 @@ struct vb2_public_key {
const uint32_t *rr; /* R^2 as little endian array */
enum vb2_signature_algorithm sig_alg; /* Signature algorithm */
enum vb2_hash_algorithm hash_alg; /* Hash algorithm */
const char *desc; /* Description */
uint32_t version; /* Key version */
const struct vb2_guid *guid; /* Key GUID */
};
/**