diff options
| author | Jaymes Wilks <mjwilks@us.ibm.com> | 2016-10-17 12:15:40 -0500 |
|---|---|---|
| committer | Daniel M. Crowell <dcrowell@us.ibm.com> | 2016-11-14 17:17:33 -0500 |
| commit | 16263a641c48773091dd60b55e28ad77ca5a8574 (patch) | |
| tree | 97120f76deb4132a1a1b7ceba8701318c5663a68 /src/usr/secureboot | |
| parent | a904e156364a8f0fd5f6bc2b7094f79cf77da1b2 (diff) | |
| download | talos-hostboot-16263a641c48773091dd60b55e28ad77ca5a8574.tar.gz talos-hostboot-16263a641c48773091dd60b55e28ad77ca5a8574.zip | |
Secure PNOR Resource Provider port from p8
Adds a Secure PNOR Resource Provider (SPNORRP) layer on top of the
original PNORRP to handle verification of secured PNOR sections.
Change-Id: Iff25abf599f3c850197c6e6d23ff03e5edf945bb
RTC:163078
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31588
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com>
Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/secureboot')
| -rw-r--r-- | src/usr/secureboot/base/containerheader.C | 248 | ||||
| -rw-r--r-- | src/usr/secureboot/base/header.C | 33 | ||||
| -rw-r--r-- | src/usr/secureboot/base/makefile | 5 | ||||
| -rw-r--r-- | src/usr/secureboot/base/securerom.C | 19 | ||||
| -rw-r--r-- | src/usr/secureboot/base/securerom.H | 10 | ||||
| -rw-r--r-- | src/usr/secureboot/base/service.C | 110 | ||||
| -rw-r--r-- | src/usr/secureboot/base/test/secureromtest.H | 3 | ||||
| -rw-r--r-- | src/usr/secureboot/header.H | 53 | ||||
| -rw-r--r-- | src/usr/secureboot/trusted/base/trustedboot_base.C | 23 |
9 files changed, 406 insertions, 98 deletions
diff --git a/src/usr/secureboot/base/containerheader.C b/src/usr/secureboot/base/containerheader.C new file mode 100644 index 000000000..5f8e2fdc7 --- /dev/null +++ b/src/usr/secureboot/base/containerheader.C @@ -0,0 +1,248 @@ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/secureboot/base/containerheader.C $ */ +/* */ +/* OpenPOWER HostBoot Project */ +/* */ +/* Contributors Listed Below - COPYRIGHT 2016 */ +/* [+] International Business Machines Corp. */ +/* */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ +#include <secureboot/containerheader.H> + +extern trace_desc_t* g_trac_secure; + +// Quick change for unit testing +//#define TRACUCOMP(args...) TRACFCOMP(args) +#define TRACUCOMP(args...) + +namespace SECUREBOOT +{ + +void ContainerHeader::parse_header(const void* i_header) +{ + assert(i_header != NULL); + const uint8_t* l_hdr = reinterpret_cast<const uint8_t*>(i_header); + + /*---- Parse ROM_container_raw ----*/ + // The rom code has a placeholder for the prefix in the first struct + size_t l_size = offsetof(ROM_container_raw, prefix); + safeMemCpyAndInc(&iv_headerInfo.hw_hdr, l_hdr, l_size); + + // Early check if magic number is valid, as a quick check to try and prevent + // any storage exceptions while parsing header. + assert(iv_headerInfo.hw_hdr.magic_number == MAGIC_NUMBER, + "ContainerHeader: magic number = 0x%08X not valid", + iv_headerInfo.hw_hdr.magic_number); + + /*---- Parse ROM_prefix_header_raw ----*/ + l_size = offsetof(ROM_prefix_header_raw, ecid); + safeMemCpyAndInc(&iv_headerInfo.hw_prefix_hdr, l_hdr, l_size); + + // Get ECID array + l_size = iv_headerInfo.hw_prefix_hdr.ecid_count * ECID_SIZE; + safeMemCpyAndInc(&iv_headerInfo.hw_prefix_hdr.ecid, l_hdr, l_size); + + /*---- Parse ROM_prefix_data_raw ----*/ + l_size = offsetof(ROM_prefix_data_raw, sw_pkey_p); + safeMemCpyAndInc(&iv_headerInfo.hw_prefix_data, l_hdr, l_size); + + // Get SW keys + l_size = iv_headerInfo.hw_prefix_hdr.sw_key_count * sizeof(ecc_key_t); + // Cache total software keys size + iv_totalSwKeysSize = l_size; + safeMemCpyAndInc(&iv_headerInfo.hw_prefix_data.sw_pkey_p, l_hdr, l_size); + + /*---- Parse ROM_sw_header_raw ----*/ + l_size = offsetof(ROM_sw_header_raw, ecid); + safeMemCpyAndInc(&iv_headerInfo.sw_hdr, l_hdr, l_size); + + // Get ECID array + l_size = iv_headerInfo.sw_hdr.ecid_count * ECID_SIZE; + safeMemCpyAndInc(&iv_headerInfo.sw_hdr.ecid, l_hdr, l_size); + + /*---- Parse ROM_sw_sig_raw ----*/ + safeMemCpyAndInc(&iv_headerInfo.sw_sig.sw_sig_p, l_hdr, iv_totalSwKeysSize); + + // Parse hw and sw flags + parseFlags(); + + // Generate hw hash key + genHwKeyHash(); + + // After parsing check if header is valid, do some quick bound checks + validate(); + + // Debug printing + print(); +} + +void ContainerHeader::print() const +{ +#ifdef HOSTBOOT_DEBUG + TRACFCOMP(g_trac_secure, ENTER_MRK"ContainerHeader::print"); + + TRACFCOMP(g_trac_secure,"header content size 0x%X", iv_hdrBytesRead); + + /*---- Print ROM_container_raw ----*/ + TRACFCOMP(g_trac_secure,"magic_number 0x%X", iv_headerInfo.hw_hdr.magic_number); + TRACFCOMP(g_trac_secure,"version 0x%X", iv_headerInfo.hw_hdr.version); + TRACFCOMP(g_trac_secure,"container_size 0x%X", iv_headerInfo.hw_hdr.container_size); + TRACFCOMP(g_trac_secure,"target_hrmor 0x%X", iv_headerInfo.hw_hdr.target_hrmor); + TRACFCOMP(g_trac_secure,"stack_pointer 0x%X", iv_headerInfo.hw_hdr.stack_pointer); + TRACFBIN(g_trac_secure,"hw_pkey_a", iv_headerInfo.hw_hdr.hw_pkey_a, 64); + TRACFBIN(g_trac_secure,"hw_pkey_b", iv_headerInfo.hw_hdr.hw_pkey_b, 64); + TRACFBIN(g_trac_secure,"hw_pkey_c", iv_headerInfo.hw_hdr.hw_pkey_c, 64); + + /*---- Print ROM_prefix_header_raw ----*/ + TRACFCOMP(g_trac_secure,"hw_flags 0x%X", iv_headerInfo.hw_prefix_hdr.flags); + TRACFCOMP(g_trac_secure,"sw_key_count 0x%X", iv_headerInfo.hw_prefix_hdr.sw_key_count); + TRACFBIN(g_trac_secure,"sw public key hash", iv_headerInfo.hw_prefix_hdr.payload_hash, SHA512_DIGEST_LENGTH); + + /*---- Print ROM_prefix_data_raw ----*/ + TRACFBIN(g_trac_secure,"sw_pkey_p", iv_headerInfo.hw_prefix_data.sw_pkey_p, sizeof(ecc_key_t)); + if (iv_headerInfo.hw_prefix_hdr.sw_key_count>1) + { + TRACFBIN(g_trac_secure,"sw_pkey_q", iv_headerInfo.hw_prefix_data.sw_pkey_q, sizeof(ecc_key_t)); + } + if (iv_headerInfo.hw_prefix_hdr.sw_key_count>2) + { + TRACFBIN(g_trac_secure,"sw_pkey_r", iv_headerInfo.hw_prefix_data.sw_pkey_r, sizeof(ecc_key_t)); + } + + /*---- Print ROM_sw_header_raw ----*/ + TRACFCOMP(g_trac_secure,"payload_size 0x%X", iv_headerInfo.sw_hdr.payload_size ); + TRACFBIN(g_trac_secure,"payload_hash", iv_headerInfo.sw_hdr.payload_hash, SHA512_DIGEST_LENGTH); + + /*---- Print ROM_sw_sig_raw ----*/ + TRACFBIN(g_trac_secure,"sw_sig_p", iv_headerInfo.sw_sig.sw_sig_p, sizeof(ecc_key_t)); + if (iv_headerInfo.hw_prefix_hdr.sw_key_count>1) + { + TRACFBIN(g_trac_secure,"sw_sig_q", iv_headerInfo.sw_sig.sw_sig_q, sizeof(ecc_key_t)); + } + if (iv_headerInfo.hw_prefix_hdr.sw_key_count>2) + { + TRACFBIN(g_trac_secure,"sw_sig_r", iv_headerInfo.sw_sig.sw_sig_r, sizeof(ecc_key_t)); + } + + TRACFCOMP(g_trac_secure, EXIT_MRK"ContainerHeader::print"); +#endif +} + +size_t ContainerHeader::totalContainerSize() const +{ + return iv_headerInfo.hw_hdr.container_size; +} + +const ecc_key_t* ContainerHeader::hw_keys() const +{ + return &iv_headerInfo.hw_hdr.hw_pkey_a; +} + +size_t ContainerHeader::payloadTextSize() const +{ + return iv_headerInfo.sw_hdr.payload_size; +} + +const SHA512_t* ContainerHeader::payloadTextHash() const +{ + return &iv_headerInfo.sw_hdr.payload_hash; +} + +size_t ContainerHeader::totalSwKeysSize() const +{ + return iv_totalSwKeysSize; +} + +const ecc_key_t* ContainerHeader::sw_keys() const +{ + return &iv_headerInfo.hw_prefix_data.sw_pkey_p; +} + +const SHA512_t* ContainerHeader::swKeyHash() const +{ + return &iv_headerInfo.hw_prefix_hdr.payload_hash; +} + +const ecc_key_t* ContainerHeader::sw_sigs() const +{ + return &iv_headerInfo.sw_sig.sw_sig_p; +} + +const sb_flags_t* ContainerHeader::sb_flags() const +{ + return &iv_sbFlags; +} + +const SHA512_t* ContainerHeader::hwKeyHash() const +{ + return &iv_hwKeyHash; +} + +void ContainerHeader::validate() +{ + iv_isValid = (iv_hdrBytesRead <= MAX_SECURE_HEADER_SIZE) + && (iv_headerInfo.hw_hdr.magic_number == MAGIC_NUMBER) + && (iv_headerInfo.hw_hdr.version == ROM_VERSION) + && (iv_headerInfo.hw_prefix_hdr.ver_alg.version == ROM_VERSION) + && (iv_headerInfo.hw_prefix_hdr.ver_alg.hash_alg == ROM_HASH_ALG) + && (iv_headerInfo.hw_prefix_hdr.ver_alg.sig_alg == ROM_SIG_ALG) + && (iv_headerInfo.hw_prefix_hdr.sw_key_count >= SW_KEY_COUNT_MIN) + && (iv_headerInfo.hw_prefix_hdr.sw_key_count <= SW_KEY_COUNT_MAX) + && (iv_headerInfo.sw_hdr.payload_size != 0); +} + +void ContainerHeader::safeMemCpyAndInc(void* i_dest, const uint8_t* &io_hdr, + const size_t i_size) +{ + assert(i_dest != NULL, "ContainerHeader: dest ptr NULL"); + assert(io_hdr != NULL, "ContainerHeader: current header location ptr NULL"); + assert(iv_pHdrStart != NULL, "ContainerHeader: start of header ptr NULL"); + + TRACDCOMP(g_trac_secure,"dest: 0x%X src: 0x%X size: 0x%X",i_dest, io_hdr, i_size); + + // Determine if the memcpy is within the bounds of the container header + iv_hdrBytesRead = io_hdr - iv_pHdrStart; + assert( (iv_hdrBytesRead + i_size) <= MAX_SECURE_HEADER_SIZE, + "ContainerHeader: memcpy is out of bounds of max header size"); + + memcpy(i_dest, io_hdr, i_size); + io_hdr += i_size; +} + +bool ContainerHeader::isValid() const +{ + return iv_isValid; +} + +void ContainerHeader::parseFlags() +{ + iv_sbFlags.hw_hb_fw = iv_headerInfo.hw_prefix_hdr.flags & HB_FW_FLAG; + iv_sbFlags.hw_opal = iv_headerInfo.hw_prefix_hdr.flags & OPAL_FLAG; + iv_sbFlags.hw_phyp = iv_headerInfo.hw_prefix_hdr.flags & PHYP_FLAG; + iv_sbFlags.hw_key_transition = iv_headerInfo.hw_prefix_hdr.flags + & KEY_TRANSITION_FLAG; +} + +void ContainerHeader::genHwKeyHash() +{ + // Generate and store hw hash key + SECUREBOOT::hashBlob(&iv_headerInfo.hw_hdr.hw_pkey_a, + totalHwKeysSize, iv_hwKeyHash); +} + +}; //end of SECUREBOOT namespace diff --git a/src/usr/secureboot/base/header.C b/src/usr/secureboot/base/header.C index 23cefcf84..37ba7ca72 100644 --- a/src/usr/secureboot/base/header.C +++ b/src/usr/secureboot/base/header.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ +/* Contributors Listed Below - COPYRIGHT 2013,2016 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -20,13 +22,21 @@ /* permissions and limitations under the License. */ /* */ /* IBM_PROLOG_END_TAG */ -#include "header.H" +#include <secureboot/header.H> #include <sys/mm.h> #include <sys/mmio.h> #include <kernel/console.H> namespace SECUREBOOT { + Header& baseHeader() + { + return Singleton<Header>::instance(); + } + + // TODO securebootp9 this implementation native to p9 appears to be doing + // approximately the same thing as p8's loadSecurely() method. We need to + // confirm and merge together or leave separate and merely remove comment. void Header::loadBaseHeader() { // Calculate original address of the secureboot header. @@ -54,4 +64,23 @@ namespace SECUREBOOT return; } + + // TODO securebootp9 this implementation of the follwoing two methods need + // to be added based on p8 code + void Header::loadSecurely() + { + } + + void Header::setNonSecurely( + const void* i_pHeader) + { + } + + void Header::getHeader( + const void*& o_pHeader ) const + { + // Fatal code bug if queried before loaded + assert(iv_data!=nullptr); + o_pHeader = iv_data; + } } diff --git a/src/usr/secureboot/base/makefile b/src/usr/secureboot/base/makefile index 1c13cc289..e2b143978 100644 --- a/src/usr/secureboot/base/makefile +++ b/src/usr/secureboot/base/makefile @@ -24,6 +24,7 @@ # IBM_PROLOG_END_TAG ROOTPATH = ../../../.. MODULE = secureboot_base +include ../common/common.mk SUBDIRS += test.d OBJS += service.o @@ -33,6 +34,10 @@ OBJS += securerom.o OBJS += rom_entry.o OBJS += trustedboot_base.o OBJS += $(if $(CONFIG_TPMDD),trustedbootMsg.o,) +OBJS += containerheader.o +OBJS += ${SECUREBOOT_COMMON_OBJS} + +VPATH += ../common EXTRAINCDIR += ${ROOTPATH}/src/usr/secureboot/trusted/base VPATH += ${ROOTPATH}/src/usr/secureboot/trusted/base diff --git a/src/usr/secureboot/base/securerom.C b/src/usr/secureboot/base/securerom.C index 82a72c185..dd859c6ab 100644 --- a/src/usr/secureboot/base/securerom.C +++ b/src/usr/secureboot/base/securerom.C @@ -62,23 +62,27 @@ errlHndl_t initializeSecureROM(void) return Singleton<SecureROM>::instance().initialize(); } + +// TODO securebootp9 - the method signature below was brought in from +// p8. There are many more changes need to this file however, in order to +// be considered up-to-date. /** * @brief Verify Signed Container */ -errlHndl_t verifyContainer(void * i_container, size_t i_size) +errlHndl_t verifyContainer(void * i_container, const sha2_hash_t* i_hwKeyHash) { TRACUCOMP(g_trac_secure, "verifyContainer(): i_container=%p, size=0x%x", i_container, i_size); return Singleton<SecureROM>::instance().verifyContainer(i_container, - i_size); + i_hwKeyHash); } /** * @brief Hash Signed Blob * */ -errlHndl_t hashBlob(void * i_blob, size_t i_size, SHA512_t io_buf) +errlHndl_t hashBlob(const void * i_blob, size_t i_size, SHA512_t io_buf) { return Singleton<SecureROM>::instance().hashBlob(i_blob, i_size, io_buf); @@ -297,10 +301,13 @@ errlHndl_t SecureROM::initialize() /** * @brief Verify Container against system hash keys */ -errlHndl_t SecureROM::verifyContainer(void * i_container, size_t i_size) +errlHndl_t SecureROM::verifyContainer(void * i_container, +// TODO securebootp9 - this is dummy parameter added to aid in p9 port +// need to replace the method below with up-to-date version + const sha2_hash_t* i_hwKeyHash) { TRACDCOMP(g_trac_secure,ENTER_MRK"SecureROM::verifyContainer(): " - "i_container=%p, size=0x%x", i_container, i_size); + "i_container=%p", i_container); errlHndl_t l_errl = NULL; @@ -410,7 +417,7 @@ errlHndl_t SecureROM::verifyContainer(void * i_container, size_t i_size) /** * @brief Hash Blob */ -errlHndl_t SecureROM::hashBlob(void * i_blob, size_t i_size, SHA512_t io_buf) +errlHndl_t SecureROM::hashBlob(const void * i_blob, size_t i_size, SHA512_t io_buf) const { TRACDCOMP(g_trac_secure,INFO_MRK"SecureROM::hashBlob() NOT " diff --git a/src/usr/secureboot/base/securerom.H b/src/usr/secureboot/base/securerom.H index cd5688cc4..bfb16f88b 100644 --- a/src/usr/secureboot/base/securerom.H +++ b/src/usr/secureboot/base/securerom.H @@ -139,11 +139,13 @@ class SecureROM * * @param[in] i_container Void pointer to effective address * of container - * @param[in] i_size Size of container + * @param[in] i_hwKeyHash Custom hw keys' hash to test against + * [default = nullptr, use current hw hash key * - * @return errlHndl_t NULL on success + * @return errlHndl_t NULL on success */ - errlHndl_t verifyContainer(void * i_container, size_t i_size); + errlHndl_t verifyContainer(void * i_container, + const sha2_hash_t* i_hwKeyHash = nullptr); /** * @brief Hash Blob @@ -155,7 +157,7 @@ class SecureROM * * @return errlHndl_t NULL on success */ - errlHndl_t hashBlob(void * i_blob, size_t i_size, SHA512_t io_buf); + errlHndl_t hashBlob(const void * i_blob, size_t i_size, SHA512_t io_buf) const; /** * @brief Retrieve the internal hardware hash key from secure ROM diff --git a/src/usr/secureboot/base/service.C b/src/usr/secureboot/base/service.C index 435ababfd..ade0e4a9f 100644 --- a/src/usr/secureboot/base/service.C +++ b/src/usr/secureboot/base/service.C @@ -28,50 +28,98 @@ #include <util/singleton.H> #include <secureboot/secure_reasoncodes.H> #include <config.h> - +#include <devicefw/userif.H> +#include <targeting/common/utilFilter.H> +#include <targeting/common/targetservice.H> +#include <errl/errlentry.H> +#include <errl/errlmanager.H> +#include <errl/errludtarget.H> +#include <initservice/initserviceif.H> #include "settings.H" -#include "header.H" +#include <secureboot/header.H> #include "purge.H" #include <kernel/misc.H> +#include <kernel/console.H> +#include <console/consoleif.H> + +extern trace_desc_t* g_trac_secure; + +// Quick change for unit testing +//#define TRACUCOMP(args...) TRACFCOMP(args) +#define TRACUCOMP(args...) + + +using namespace ERRORLOG; +using namespace TARGETING; namespace SECUREBOOT { - void* initializeBase(void* unused) + +// TODO securebootp9 - Do a diff of this file with the p8 version make sure +// all the missing parts are brought in. + +void* initializeBase(void* unused) +{ + errlHndl_t l_errl = NULL; + + do { - errlHndl_t l_errl = NULL; - do + // Load original secureboot header. + if (enabled()) { + Singleton<Header>::instance().loadBaseHeader(); + } - // Load original secureboot header. - if (enabled()) - { - Singleton<Header>::instance().loadBaseHeader(); - } - - // Extend memory footprint into lower portion of cache. - assert(0 == mm_extend(MM_EXTEND_PARTIAL_CACHE)); + // Extend memory footprint into lower portion of cache. + assert(0 == mm_extend(MM_EXTEND_PARTIAL_CACHE)); - // Don't extend more than 1/2 cache in VPO as fake PNOR is there - // Don't enable SecureROM in VPO + // Don't extend more than 1/2 cache in VPO as fake PNOR is there + // Don't enable SecureROM in VPO #ifndef CONFIG_P9_VPO_COMPILE - // Run dcbz on the entire 10MB cache - assert(0 == mm_extend(MM_EXTEND_FULL_CACHE)); - - // Initialize the Secure ROM - l_errl = initializeSecureROM(); - if (l_errl) - { - break; - } + // Run dcbz on the entire 10MB cache + assert(0 == mm_extend(MM_EXTEND_FULL_CACHE)); + + // Initialize the Secure ROM + l_errl = initializeSecureROM(); + if (l_errl) + { + break; + } +#endif + } while(0); + + return l_errl; +} + +bool enabled() +{ + return Singleton<Settings>::instance().getEnabled(); +} + +void handleSecurebootFailure(errlHndl_t &i_err) +{ + TRACFCOMP( g_trac_secure, ENTER_MRK"handleSecurebootFailure()"); + + assert(i_err != NULL, "Secureboot Failure has a NULL error log") + + // Grab errlog reason code before committing. + uint16_t l_rc = i_err->reasonCode(); + +#ifdef CONFIG_CONSOLE + CONSOLE::displayf(SECURE_COMP_NAME, "Secureboot Failure plid = 0x%08X, rc = 0x%04X\n", + i_err->plid(), l_rc); #endif - } while(0); + printk("Secureboot Failure plid = 0x%08X, rc = 0x%04X\n", + i_err->plid(),l_rc); - return l_errl; - } + // Add Verification callout + i_err->addProcedureCallout(HWAS::EPUB_PRC_FW_VERIFICATION_ERR, + HWAS::SRCI_PRIORITY_HIGH); + errlCommit(i_err, SECURE_COMP_ID); + + // Shutdown with Secureboot error status + INITSERVICE::doShutdown(l_rc); +} - bool enabled() - { - return Singleton<Settings>::instance().getEnabled(); - } } diff --git a/src/usr/secureboot/base/test/secureromtest.H b/src/usr/secureboot/base/test/secureromtest.H index 9de9aaa80..d324de8cc 100644 --- a/src/usr/secureboot/base/test/secureromtest.H +++ b/src/usr/secureboot/base/test/secureromtest.H @@ -136,8 +136,7 @@ class SecureROMTest : public CxxTest::TestSuite // Warn about the exception being handled during verification printkd("test_verify(): expect to see 'mfsr r2 to CFAR handled': "); - l_errl = l_sRom.verifyContainer( signedFile_pageAddr, - signedFile_size ); + l_errl = l_sRom.verifyContainer( signedFile_pageAddr); if (l_errl) { diff --git a/src/usr/secureboot/header.H b/src/usr/secureboot/header.H deleted file mode 100644 index a78f79b80..000000000 --- a/src/usr/secureboot/header.H +++ /dev/null @@ -1,53 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/usr/secureboot/header.H $ */ -/* */ -/* OpenPOWER HostBoot Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 2013,2014 */ -/* */ -/* Licensed under the Apache License, Version 2.0 (the "License"); */ -/* you may not use this file except in compliance with the License. */ -/* You may obtain a copy of the License at */ -/* */ -/* http://www.apache.org/licenses/LICENSE-2.0 */ -/* */ -/* Unless required by applicable law or agreed to in writing, software */ -/* distributed under the License is distributed on an "AS IS" BASIS, */ -/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ -/* implied. See the License for the specific language governing */ -/* permissions and limitations under the License. */ -/* */ -/* IBM_PROLOG_END_TAG */ -#ifndef __SECUREBOOT_HEADER_H -#define __SECUREBOOT_HEADER_H - -#include <stdint.h> - -/** @file header.H - * - * @brief Classes for manipulating Secureboot headers. - */ - -namespace SECUREBOOT -{ - /** @class Header - * @brief Class for storing the original Secureboot header for later use. - */ - class Header - { - public: - Header() : iv_data(NULL) {}; - ~Header() {}; - - /** @brief Extract header from original HRMOR - 1 page address. */ - void loadBaseHeader(); - - private: - /** Copy of the original secureboot header for the base image. */ - void* iv_data; - }; -}; - -#endif diff --git a/src/usr/secureboot/trusted/base/trustedboot_base.C b/src/usr/secureboot/trusted/base/trustedboot_base.C index 687aeb9f0..dbb47b6e5 100644 --- a/src/usr/secureboot/trusted/base/trustedboot_base.C +++ b/src/usr/secureboot/trusted/base/trustedboot_base.C @@ -255,4 +255,27 @@ errlHndl_t pcrExtend(TPM_Pcr i_pcr, return err; } +errlHndl_t extendPnorSectionHash(const SECUREBOOT::ContainerHeader& i_conHdr, + const void* i_vaddr, + const PNOR::SectionId i_sec) +{ + errlHndl_t l_errhdl = NULL; + + // TODO securebootp9 + // remove the following code and implement based on p8 code + TRACFCOMP(g_trac_trustedboot, "ExtendPnorSectionHash called for section %d and " + " address %.16llX with payload text size %i" + "but not unimplemented in p9", i_sec, i_vaddr); + + return l_errhdl; +} + +errlHndl_t extendBaseImage() +{ + errlHndl_t pError = NULL; + // TODO securebootp9 + // implement extendBaseImage based on p8 code + return pError; +} + } // end TRUSTEDBOOT |

