diff options
author | Stephen Cprek <smcprek@us.ibm.com> | 2017-12-05 16:46:54 -0600 |
---|---|---|
committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2017-12-12 17:16:19 -0500 |
commit | 82f341573515e1dd39c622a955e08d3ab669b458 (patch) | |
tree | 6fce1174aa6d97efd8d84101216f1cc6cc1ee0db /src/usr/secureboot/common/containerheader.C | |
parent | fa2acdeb7202692ab0153579b007c70b372a88b4 (diff) | |
download | talos-hostboot-82f341573515e1dd39c622a955e08d3ab669b458.tar.gz talos-hostboot-82f341573515e1dd39c622a955e08d3ab669b458.zip |
Fix incorrect size for entries going into hb resv memory
Sections that do not have Secure Headers and need one injected were
not passing in the correct size to preverifiedlidmgr.
e.g. RINGOVD section or when SB is compiled out
Change-Id: I6e8c775a9a1d3f89473c55af6efc8109fb378c99
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/50545
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot/common/containerheader.C')
-rw-r--r-- | src/usr/secureboot/common/containerheader.C | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/usr/secureboot/common/containerheader.C b/src/usr/secureboot/common/containerheader.C index 47ccfebea..e01b09b8b 100644 --- a/src/usr/secureboot/common/containerheader.C +++ b/src/usr/secureboot/common/containerheader.C @@ -171,7 +171,7 @@ void ContainerHeader::initVars() memset(iv_componentId,0x00,sizeof(iv_componentId)); } -void ContainerHeader::genFakeHeader(const size_t i_totalSize, +void ContainerHeader::genFakeHeader(const size_t i_size, const char* const i_compId) { SecureHeaderInfo info {}; @@ -182,7 +182,7 @@ void ContainerHeader::genFakeHeader(const size_t i_totalSize, /*---- ROM_container_raw ----*/ info.hw_hdr.magic_number = ROM_MAGIC_NUMBER; info.hw_hdr.version = CONTAINER_VERSION; - info.hw_hdr.container_size = i_totalSize; + info.hw_hdr.container_size = i_size + PAGE_SIZE; // The rom code has a placeholder for the prefix in the first struct so // skip it size_t l_size = offsetof(ROM_container_raw, prefix); @@ -212,7 +212,7 @@ void ContainerHeader::genFakeHeader(const size_t i_totalSize, strncpy(info.sw_hdr.component_id, i_compId,SW_HDR_COMP_ID_SIZE_BYTES); info.sw_hdr.ver_alg.hash_alg = HASH_ALG_SHA512; info.sw_hdr.ver_alg.sig_alg = SIG_ALG_ECDSA521; - info.sw_hdr.payload_size = i_totalSize - PAGE_SIZE; + info.sw_hdr.payload_size = i_size; l_size = offsetof(ROM_sw_header_raw, ecid); l_size += info.hw_prefix_hdr.ecid_count * ECID_SIZE; |