summaryrefslogtreecommitdiffstats
path: root/src/usr
diff options
context:
space:
mode:
authorJaymes Wilks <mjwilks@us.ibm.com>2017-07-25 16:08:02 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-04 09:53:51 -0400
commit0914d87ae57960ef859886a67b5ae1187aa82474 (patch)
treead0c445fa7b0294150e0a5ff3aadc955ea40ca89 /src/usr
parent69b38d2b257691fb31347ef0ab1ffab9f74d8ab7 (diff)
downloadtalos-hostboot-0914d87ae57960ef859886a67b5ae1187aa82474.tar.gz
talos-hostboot-0914d87ae57960ef859886a67b5ae1187aa82474.zip
Fix duplicate sha512 definitions
All instances for sha2_hash_t have been replaced with SHA512_t and the SHA512_t typedef is now in securerom/contrib/sha512.H in place of the old definition. Change-Id: I32524524d755eb3b0264881317d9be5a294dc9a7 RTC:172333 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/43610 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@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> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@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')
-rw-r--r--src/usr/secureboot/base/securerommgr.C20
-rw-r--r--src/usr/secureboot/base/securerommgr.H8
-rw-r--r--src/usr/secureboot/base/test/securerommgrtest.H2
-rw-r--r--src/usr/secureboot/trusted/trustedboot.C4
4 files changed, 17 insertions, 17 deletions
diff --git a/src/usr/secureboot/base/securerommgr.C b/src/usr/secureboot/base/securerommgr.C
index 3c9e28db6..dc8e6155c 100644
--- a/src/usr/secureboot/base/securerommgr.C
+++ b/src/usr/secureboot/base/securerommgr.C
@@ -67,7 +67,7 @@ errlHndl_t initializeSecureRomManager(void)
/**
* @brief Verify Signed Container
*/
-errlHndl_t verifyContainer(void * i_container, const sha2_hash_t* i_hwKeyHash)
+errlHndl_t verifyContainer(void * i_container, const SHA512_t* i_hwKeyHash)
{
errlHndl_t l_errl = nullptr;
@@ -112,7 +112,7 @@ void hashConcatBlobs(const blobPair_t &i_blobs, SHA512_t o_buf)
/*
* @brief Externally available hardware keys' hash retrieval function
*/
-void getHwKeyHash(sha2_hash_t o_hash)
+void getHwKeyHash(SHA512_t o_hash)
{
// @TODO RTC:170136 remove isValid check
if(Singleton<SecureRomManager>::instance().isValid())
@@ -269,7 +269,7 @@ errlHndl_t SecureRomManager::initialize()
* @brief Verify Container against system hash keys
*/
errlHndl_t SecureRomManager::verifyContainer(void * i_container,
- const sha2_hash_t* i_hwKeyHash)
+ const SHA512_t* i_hwKeyHash)
{
TRACDCOMP(g_trac_secure,ENTER_MRK"SecureRomManager::verifyContainer(): "
"i_container=%p", i_container);
@@ -300,16 +300,16 @@ errlHndl_t SecureRomManager::verifyContainer(void * i_container,
// struct elements my_ecid, entry_point and log
memset(&l_hw_parms, 0, sizeof(ROM_hw_params));
- // Now set hw_key_hash, which is of type sha2_hash_t, to iv_key_hash
+ // Now set hw_key_hash, which is of type SHA512_t, to iv_key_hash
if (i_hwKeyHash == nullptr)
{
// Use current hw hash key
- memcpy (&l_hw_parms.hw_key_hash, iv_key_hash, sizeof(sha2_hash_t));
+ memcpy (&l_hw_parms.hw_key_hash, iv_key_hash, sizeof(SHA512_t));
}
else
{
// Use custom hw hash key
- memcpy (&l_hw_parms.hw_key_hash, i_hwKeyHash, sizeof(sha2_hash_t));
+ memcpy (&l_hw_parms.hw_key_hash, i_hwKeyHash, sizeof(SHA512_t));
}
/*******************************************************************/
@@ -408,7 +408,7 @@ void SecureRomManager::hashBlob(const void * i_blob, size_t i_size, SHA512_t o_b
call_rom_SHA512(reinterpret_cast<void*>(l_rom_SHA512_startAddr),
reinterpret_cast<const sha2_byte*>(i_blob),
i_size,
- reinterpret_cast<sha2_hash_t*>(o_buf));
+ reinterpret_cast<SHA512_t*>(o_buf));
TRACUCOMP(g_trac_secure,"SecureRomManager::hashBlob(): "
"call_rom_SHA512: blob=%p size=0x%X addr=%p (iv_d_p=%p)",
@@ -460,7 +460,7 @@ void SecureRomManager::getHwKeyHash()
// Check if secureboot data is valid.
if (iv_secureromValid)
{
- iv_key_hash = reinterpret_cast<const sha2_hash_t*>(
+ iv_key_hash = reinterpret_cast<const SHA512_t*>(
g_BlToHbDataManager.getHwKeysHash());
}
}
@@ -468,12 +468,12 @@ void SecureRomManager::getHwKeyHash()
/**
* @brief Retrieve the internal hardware keys' hash from secure ROM object.
*/
-void SecureRomManager::getHwKeyHash(sha2_hash_t o_hash)
+void SecureRomManager::getHwKeyHash(SHA512_t o_hash)
{
// Check if secureboot data is valid.
if (iv_secureromValid)
{
- memcpy(o_hash, iv_key_hash, sizeof(sha2_hash_t));
+ memcpy(o_hash, iv_key_hash, sizeof(SHA512_t));
}
}
diff --git a/src/usr/secureboot/base/securerommgr.H b/src/usr/secureboot/base/securerommgr.H
index 5b3d1ce50..bf8812342 100644
--- a/src/usr/secureboot/base/securerommgr.H
+++ b/src/usr/secureboot/base/securerommgr.H
@@ -59,7 +59,7 @@ class SecureRomManager
* @return errlHndl_t NULL on success
*/
errlHndl_t verifyContainer(void * i_container,
- const sha2_hash_t* i_hwKeyHash = nullptr);
+ const SHA512_t* i_hwKeyHash = nullptr);
/**
* @brief Hash Blob
@@ -77,10 +77,10 @@ class SecureRomManager
* @brief Retrieve the internal hardware keys' hash from secure ROM
* object.
*
- * @param[out] o_hash Reference to the sha2_hash_t array to copy the
+ * @param[out] o_hash Reference to the SHA512_t array to copy the
* hash to.
*/
- void getHwKeyHash(sha2_hash_t o_hash);
+ void getHwKeyHash(SHA512_t o_hash);
/*
* @brief Hash the concatenation of N Blobs
@@ -158,7 +158,7 @@ class SecureRomManager
/**
* HW key' hash retrieved from system
*/
- const sha2_hash_t* iv_key_hash;
+ const SHA512_t* iv_key_hash;
/**
* @brief Map to find verify SecureROM function types and their
diff --git a/src/usr/secureboot/base/test/securerommgrtest.H b/src/usr/secureboot/base/test/securerommgrtest.H
index a26b18b96..7db0dc2cc 100644
--- a/src/usr/secureboot/base/test/securerommgrtest.H
+++ b/src/usr/secureboot/base/test/securerommgrtest.H
@@ -69,7 +69,7 @@ void unloadSignedFile( void * & io_signedFile_pageAddr,
// secureboot_signed_container was generated using this hw hash key. If another
// key is in the HBBL, this test will always fail.
-const sha2_hash_t hw_key_hash =
+const SHA512_t hw_key_hash =
{
0x40,0xd4,0x87,0xff,0x73,0x80,0xed,0x6a,
0xd5,0x47,0x75,0xd5,0x79,0x5f,0xea,0x0d,
diff --git a/src/usr/secureboot/trusted/trustedboot.C b/src/usr/secureboot/trusted/trustedboot.C
index 20a099adb..6682bf829 100644
--- a/src/usr/secureboot/trusted/trustedboot.C
+++ b/src/usr/secureboot/trusted/trustedboot.C
@@ -703,11 +703,11 @@ errlHndl_t tpmLogConfigEntries(TRUSTEDBOOT::TpmTarget* const i_pTpm)
}
// HW Key Hash
- sha2_hash_t l_hw_key_hash;
+ SHA512_t l_hw_key_hash;
SECUREBOOT::getHwKeyHash(l_hw_key_hash);
l_err = pcrExtend(PCR_1, EV_PLATFORM_CONFIG_FLAGS,
l_hw_key_hash,
- sizeof(sha2_hash_t),"HW KEY HASH");
+ sizeof(SHA512_t),"HW KEY HASH");
if (l_err)
{
break;
OpenPOWER on IntegriCloud