summaryrefslogtreecommitdiffstats
path: root/src/usr/sbe/test
diff options
context:
space:
mode:
authorMike Baiocchi <mbaiocch@us.ibm.com>2017-03-27 08:13:15 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-04-03 11:22:19 -0400
commit5284cb4636143bc16ce06c10f40133639e35a3be (patch)
tree989ee196c2e86f855069a5944ef1a90793b18d12 /src/usr/sbe/test
parent3eac7d61c5a1f78006c1c4b0e9621d91e2dbf47f (diff)
downloadtalos-hostboot-5284cb4636143bc16ce06c10f40133639e35a3be.tar.gz
talos-hostboot-5284cb4636143bc16ce06c10f40133639e35a3be.zip
Read the HW Key Hash from a Processor's SBE Seeprom
This commit adds an interface to read the HW Key Hash located in the HBBL section of each Processor's two SBE Seeproms. Change-Id: I906434269746c296c646f7b0594575c58b145294 RTC: 167585 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/38465 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Martin Gloff <mgloff@us.ibm.com> Reviewed-by: Stephen M. Cprek <smcprek@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbe/test')
-rw-r--r--src/usr/sbe/test/sbeupdatetest.H31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/usr/sbe/test/sbeupdatetest.H b/src/usr/sbe/test/sbeupdatetest.H
index e9210b102..876b8e874 100644
--- a/src/usr/sbe/test/sbeupdatetest.H
+++ b/src/usr/sbe/test/sbeupdatetest.H
@@ -41,6 +41,7 @@
#include <config.h>
#include <sbe/sbeif.H>
#include "../sbe_update.H"
+#include <secureboot/service.H>
extern trace_desc_t* g_trac_sbe;
@@ -830,6 +831,36 @@ class SBEUpdateTest: public CxxTest::TestSuite
break;
}
+ total++;
+ SHA512_t hash = {0};
+ err = getHwKeyHashFromSbeSeeprom(sbeState.target,
+ EEPROM::SBE_BACKUP,
+ hash);
+
+ if(err)
+ {
+ fails++;
+ TS_FAIL("testSbeUpdateTarget() - getHwKeyHashFromSbeSeeprom() failed.");
+ break;
+ }
+
+ // Make sure that the HW Key Hash returned is the system hash
+ SHA512_t sys_hash = {0};
+ SECUREBOOT::getHwKeyHash(sys_hash);
+ if ( memcmp(hash, sys_hash, sizeof(SHA512_t)) != 0 )
+ {
+ TRACFCOMP( g_trac_sbe, ERR_MRK"testSbeUpdateTarget(): "
+ "HW Key Hashes do not match!");
+ fails++;
+ TS_FAIL("testSbeUpdateTarget() - getHwKeyHashFromSbeSeeprom() did not return system hash");
+
+ TRACFBIN( g_trac_sbe, "testSbeUpdateTarget() hash",
+ hash, sizeof(SHA512_t));
+ TRACFBIN( g_trac_sbe, "testSbeUpdateTarget() sys_hash",
+ sys_hash, sizeof(SHA512_t));
+
+ break;
+ }
}while(0);
OpenPOWER on IntegriCloud