diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-03-04 16:13:45 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-03-10 23:46:07 +0000 |
commit | 36bc59140c9d3d4110b3d1c4b7c6b0b84875e81e (patch) | |
tree | 33dacefd33271d0cb35a7f39d298e486c5387ce5 /firmware/lib21/common.c | |
parent | 0f21441e78114805e2baf61b1cabc6a5b55183c6 (diff) | |
download | vboot-36bc59140c9d3d4110b3d1c4b7c6b0b84875e81e.tar.gz |
vb21: Rename struct vb2_guid to struct vb2_id
Since the ID structure isn't a true GUID anymore, let's call it
something else.
BUG=none
BRANCH=none
TEST=make runtests
Change-Id: I96f511bd5587a94d2cc20764e26d7ef0096de04c
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/256182
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware/lib21/common.c')
-rw-r--r-- | firmware/lib21/common.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/firmware/lib21/common.c b/firmware/lib21/common.c index 7a06c8c3..c683ce3d 100644 --- a/firmware/lib21/common.c +++ b/firmware/lib21/common.c @@ -142,30 +142,28 @@ uint32_t vb2_sig_size(enum vb2_signature_algorithm sig_alg, return vb2_rsa_sig_size(sig_alg); } -const struct vb2_guid *vb2_hash_guid(enum vb2_hash_algorithm hash_alg) +const struct vb2_id *vb2_hash_id(enum vb2_hash_algorithm hash_alg) { switch(hash_alg) { #ifdef VB2_SUPPORT_SHA1 case VB2_HASH_SHA1: { - static const struct vb2_guid guid = VB2_GUID_NONE_SHA1; - return &guid; + static const struct vb2_id id = VB2_ID_NONE_SHA1; + return &id; } #endif #ifdef VB2_SUPPORT_SHA256 case VB2_HASH_SHA256: { - static const struct vb2_guid guid = - VB2_GUID_NONE_SHA256; - return &guid; + static const struct vb2_id id = VB2_ID_NONE_SHA256; + return &id; } #endif #ifdef VB2_SUPPORT_SHA512 case VB2_HASH_SHA512: { - static const struct vb2_guid guid = - VB2_GUID_NONE_SHA512; - return &guid; + static const struct vb2_id id = VB2_ID_NONE_SHA512; + return &id; } #endif default: @@ -358,8 +356,8 @@ int vb2_verify_keyblock(struct vb2_keyblock *block, if (rv) return rv; - /* Skip signature if it doesn't match the key GUID */ - if (memcmp(&sig->guid, key->guid, NUM_GUID_BYTES)) + /* Skip signature if it doesn't match the key ID */ + if (memcmp(&sig->id, key->id, VB2_ID_NUM_BYTES)) continue; /* Make sure we signed the right amount of data */ @@ -369,8 +367,8 @@ int vb2_verify_keyblock(struct vb2_keyblock *block, return vb2_verify_data(block, block->sig_offset, sig, key, wb); } - /* If we're still here, no signature matched the key GUID */ - return VB2_ERROR_KEYBLOCK_SIG_GUID; + /* If we're still here, no signature matched the key ID */ + return VB2_ERROR_KEYBLOCK_SIG_ID; } int vb2_verify_fw_preamble(struct vb2_fw_preamble *preamble, |