diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2016-05-03 16:46:55 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-05-04 11:34:09 -0700 |
commit | 8fc5916c7f66627be26203aa4f0d800a266b4b4b (patch) | |
tree | 546d75085c15269376b248f1e9b9f3c3c1f04e36 /firmware | |
parent | edc3c8e4409bd9bd5cccac8a2fe48ddd5927fa6a (diff) | |
download | vboot-8fc5916c7f66627be26203aa4f0d800a266b4b4b.tar.gz |
bdb: Rename subkey to datakeystabilize-8282.Bfirmware-gale-8281.B
This patch replaces subkey with datakey to make name use consistent
with the design document.
BUG=chrome-os-partner:51908
BRANCH=tot
TEST=make runtests
Change-Id: I3690abd51e6c18c5a1094a8449f375d803c7e0b2
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/342199
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/bdb/bdb.c | 18 | ||||
-rw-r--r-- | firmware/bdb/bdb.h | 8 | ||||
-rw-r--r-- | firmware/bdb/bdb_struct.h | 2 | ||||
-rw-r--r-- | firmware/bdb/host.c | 16 | ||||
-rw-r--r-- | firmware/bdb/host.h | 18 |
5 files changed, 31 insertions, 31 deletions
diff --git a/firmware/bdb/bdb.c b/firmware/bdb/bdb.c index abcc0b59..663b43ff 100644 --- a/firmware/bdb/bdb.c +++ b/firmware/bdb/bdb.c @@ -214,12 +214,12 @@ const void *bdb_get_oem_area_0(const void *buf) return b8 + k->struct_size; } -const struct bdb_key *bdb_get_subkey(const void *buf) +const struct bdb_key *bdb_get_datakey(const void *buf) { const struct bdb_header *h = bdb_get_header(buf); const uint8_t *b8 = bdb_get_oem_area_0(buf); - /* Subkey follows OEM area 0 */ + /* datakey follows OEM area 0 */ return (const struct bdb_key *)(b8 + h->oem_area_0_size); } @@ -313,7 +313,7 @@ int bdb_verify(const void *buf, size_t size, const uint8_t *bdb_key_digest) { const uint8_t *end = (const uint8_t *)buf + size; const struct bdb_header *h; - const struct bdb_key *bdbkey, *subkey; + const struct bdb_key *bdbkey, *datakey; const struct bdb_sig *sig; const struct bdb_data *data; const void *oem; @@ -349,13 +349,13 @@ int bdb_verify(const void *buf, size_t size, const uint8_t *bdb_key_digest) if (h->oem_area_0_size > end - (const uint8_t *)oem) return BDB_ERROR_OEM_AREA_0; - /* Sanity-check subkey */ - subkey = bdb_get_subkey(buf); - if (bdb_check_key(subkey, end - (const uint8_t *)subkey)) - return BDB_ERROR_SUBKEY; + /* Sanity-check datakey */ + datakey = bdb_get_datakey(buf); + if (bdb_check_key(datakey, end - (const uint8_t *)datakey)) + return BDB_ERROR_DATAKEY; /* Make sure enough data was signed, and the signed data fits */ - if (h->oem_area_0_size + subkey->struct_size > h->signed_size || + if (h->oem_area_0_size + datakey->struct_size > h->signed_size || h->signed_size > end - (const uint8_t *)oem) return BDB_ERROR_BDB_SIGNED_SIZE; @@ -394,7 +394,7 @@ int bdb_verify(const void *buf, size_t size, const uint8_t *bdb_key_digest) if (vb2_digest_buffer((uint8_t *)data, data->signed_size, VB2_HASH_SHA256, digest, BDB_SHA256_DIGEST_SIZE)) return BDB_ERROR_DIGEST; - if (bdb_verify_sig(subkey, sig, digest)) + if (bdb_verify_sig(datakey, sig, digest)) return BDB_ERROR_DATA_SIG; /* Return success or success-other-than-BDB-key-mismatch */ diff --git a/firmware/bdb/bdb.h b/firmware/bdb/bdb.h index 177deeae..91834913 100644 --- a/firmware/bdb/bdb.h +++ b/firmware/bdb/bdb.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015 The Chromium OS Authors. All rights reserved. +/* Copyright 2015 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -21,7 +21,7 @@ bdb_check_header(buf, size); Load and verify the entire BDB bdb_verify(buf, size, bdb_key_hash, dev_mode_flag); -Check RW subkey version. If normal boot from primary BDB, roll forward +Check RW datakey version. If normal boot from primary BDB, roll forward Check data version. If normal boot from primary BDB, roll forward */ @@ -59,7 +59,7 @@ enum bdb_return_code { BDB_ERROR_HEADER, BDB_ERROR_BDBKEY, BDB_ERROR_OEM_AREA_0, - BDB_ERROR_SUBKEY, + BDB_ERROR_DATAKEY, BDB_ERROR_BDB_SIGNED_SIZE, BDB_ERROR_HEADER_SIG, BDB_ERROR_DATA, @@ -115,7 +115,7 @@ int bdb_verify(const void *buf, size_t size, const uint8_t *bdb_key_digest); const struct bdb_header *bdb_get_header(const void *buf); const struct bdb_key *bdb_get_bdbkey(const void *buf); const void *bdb_get_oem_area_0(const void *buf); -const struct bdb_key *bdb_get_subkey(const void *buf); +const struct bdb_key *bdb_get_datakey(const void *buf); const struct bdb_sig *bdb_get_header_sig(const void *buf); const struct bdb_data *bdb_get_data(const void *buf); const void *bdb_get_oem_area_1(const void *buf); diff --git a/firmware/bdb/bdb_struct.h b/firmware/bdb/bdb_struct.h index f8d2b321..fbb0c2e1 100644 --- a/firmware/bdb/bdb_struct.h +++ b/firmware/bdb/bdb_struct.h @@ -214,7 +214,7 @@ struct bdb_data { /* Reserved; set 0 */ uint8_t reserved0[2]; - /* Number of bytes of data signed by the subkey, including this + /* Number of bytes of data signed by the datakey, including this * header */ uint32_t signed_size; diff --git a/firmware/bdb/host.c b/firmware/bdb/host.c index f6431f2e..68a62803 100644 --- a/firmware/bdb/host.c +++ b/firmware/bdb/host.c @@ -253,7 +253,7 @@ struct bdb_header *bdb_create(struct bdb_create_params *p) bdb_size = sizeof(struct bdb_header); bdb_size += p->bdbkey->struct_size; bdb_size += p->oem_area_0_size; - bdb_size += p->subkey->struct_size; + bdb_size += p->datakey->struct_size; bdb_size += sig_size; bdb_size += sizeof(struct bdb_data); bdb_size += p->oem_area_1_size; @@ -281,7 +281,7 @@ struct bdb_header *bdb_create(struct bdb_create_params *p) h->struct_size = sizeof(*h); h->bdb_load_address = p->bdb_load_address; h->bdb_size = bdb_size; - h->signed_size = p->oem_area_0_size + p->subkey->struct_size; + h->signed_size = p->oem_area_0_size + p->datakey->struct_size; h->oem_area_0_size = p->oem_area_0_size; bnext += h->struct_size; @@ -296,9 +296,9 @@ struct bdb_header *bdb_create(struct bdb_create_params *p) bnext += p->oem_area_0_size; } - /* Copy subkey */ - memcpy(bnext, p->subkey, p->subkey->struct_size); - bnext += p->subkey->struct_size; + /* Copy datakey */ + memcpy(bnext, p->datakey, p->datakey->struct_size); + bnext += p->datakey->struct_size; /* * Create header signature using private BDB key. @@ -340,9 +340,9 @@ struct bdb_header *bdb_create(struct bdb_create_params *p) memcpy(bnext, p->hash, hashes_size); bnext += hashes_size; - /* Create data signature using private subkey */ - sig = bdb_create_sig(data, data->signed_size, p->private_subkey, - p->subkey->sig_alg, p->data_sig_description); + /* Create data signature using private datakey */ + sig = bdb_create_sig(data, data->signed_size, p->private_datakey, + p->datakey->sig_alg, p->data_sig_description); memcpy(bnext, sig, sig->struct_size); /* Return the BDB */ diff --git a/firmware/bdb/host.h b/firmware/bdb/host.h index 9334680b..474d82d1 100644 --- a/firmware/bdb/host.h +++ b/firmware/bdb/host.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015 The Chromium OS Authors. All rights reserved. +/* Copyright 2015 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * @@ -30,17 +30,17 @@ bdb_verify(buf, size, bdb_key_hash, dev_mode_flag); If dev_mode_flag(), mismatch is not fatal bdb_check_sig() on BDB header sig - bdb_sha256() on OEM area 1, RW subkey + bdb_sha256() on OEM area 1, RW datakey bdb_rsa_verify() on digest using BDB key - bdb_check_key() on RW subkey + bdb_check_key() on RW datakey bdb_check_data() on RW data bdb_check_sig() on data sig bdb_sha256() on data, OEM area 1, hashes - bdb_rsa_verify() on digest using RW subkey + bdb_rsa_verify() on digest using RW datakey -Check RW subkey version. If normal boot from primary BDB, roll forward +Check RW datakey version. If normal boot from primary BDB, roll forward Check data version. If normal boot from primary BDB, roll forward */ @@ -135,13 +135,13 @@ struct bdb_create_params uint8_t *oem_area_1; uint32_t oem_area_1_size; - /* Public BDB key and subkey */ + /* Public BDB key and datakey */ struct bdb_key *bdbkey; - struct bdb_key *subkey; + struct bdb_key *datakey; - /* Private BDB key and subkey */ + /* Private BDB key and datakey */ struct rsa_st *private_bdbkey; - struct rsa_st *private_subkey; + struct rsa_st *private_datakey; /* Descriptions for header and data signatures */ char *header_sig_description; |