summaryrefslogtreecommitdiffstats
path: root/src/usr/secureboot/trusted/test
diff options
context:
space:
mode:
authorIlya Smirnov <ismirno@us.ibm.com>2019-01-29 09:54:24 -0600
committerDaniel M. Crowell <dcrowell@us.ibm.com>2019-02-20 11:38:57 -0600
commit3a6180ba355940c952f332ebd514c8eb15ef7c7a (patch)
treec89a5c02d65ab739065ef0b2369b69c5c3f814e9 /src/usr/secureboot/trusted/test
parent7c42c4cac7170fec81761a8ae35a1e110a38dcc2 (diff)
downloadtalos-hostboot-3a6180ba355940c952f332ebd514c8eb15ef7c7a.tar.gz
talos-hostboot-3a6180ba355940c952f332ebd514c8eb15ef7c7a.zip
Secureboot: Enhanced Multinode Comm: Master Node
This commit introduces the logic to create the master node nodecomm request to the slave nodes and logic to process the responses from the slave nodes. The data from the slave nodes (the slave quote) is hashed and extended into PCR1. The binary quote blob is also included in the TPM log as a log message. Additional changes: the logic to relocate the TPM log to increase its size, and the logic to allow uint8_t* instead of char* as the TPM log message. Change-Id: Ide4465f0d4a91aec815c9db5d765cdbde231dcd3 RTC: 203644 Reviewed-on: http://rchgit01.rchland.ibm.com/gerrit1/71407 Reviewed-by: Michael Baiocchi <mbaiocch@us.ibm.com> Reviewed-by: Christopher J. Engel <cjengel@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-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/trusted/test')
-rwxr-xr-xsrc/usr/secureboot/trusted/test/tpmLogMgrTest.H40
-rwxr-xr-xsrc/usr/secureboot/trusted/test/trustedbootTest.H4
2 files changed, 30 insertions, 14 deletions
diff --git a/src/usr/secureboot/trusted/test/tpmLogMgrTest.H b/src/usr/secureboot/trusted/test/tpmLogMgrTest.H
index 0e67056a8..aa0aa304b 100755
--- a/src/usr/secureboot/trusted/test/tpmLogMgrTest.H
+++ b/src/usr/secureboot/trusted/test/tpmLogMgrTest.H
@@ -5,7 +5,7 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
-/* Contributors Listed Below - COPYRIGHT 2015,2017 */
+/* Contributors Listed Below - COPYRIGHT 2015,2019 */
/* [+] International Business Machines Corp. */
/* */
/* */
@@ -198,7 +198,8 @@ class TPMLogMgrTest: public CxxTest::TestSuite
* @brief Add generic test event to log and return the event added
*/
TCG_PCR_EVENT2 addTestLogEvent(TpmLogMgr& i_logMgr,
- const char* i_logMsg)
+ const uint8_t* i_logMsg,
+ size_t i_logMsgSize)
{
// Set components of TCG_PCR_EVENT2
TPM_Pcr pcr = PCR_0;
@@ -215,14 +216,18 @@ class TPMLogMgrTest: public CxxTest::TestSuite
pcr, EV_NO_ACTION, algId,
digest, digestSize,
TPM_ALG_SHA1, digest,
- digestSize, i_logMsg);
+ digestSize, i_logMsg,
+ i_logMsgSize);
// Add event to log
errlHndl_t err = TpmLogMgr_addEvent(&i_logMgr, &eventLog);
if (err)
{
- TS_FAIL("addTestLogEvent - Failed to addEvent with message = %s",
- i_logMsg);
+ TS_FAIL("addTestLogEvent - Failed to addEvent with the following message");
+ TRACFBIN(g_trac_trustedboot,
+ "TPM log message",
+ i_logMsg,
+ i_logMsgSize);
errlCommit( err, TRBOOT_COMP_ID );
delete err;
err = NULL;
@@ -244,8 +249,10 @@ class TPMLogMgrTest: public CxxTest::TestSuite
getTestLogMgr(&logMgr);
// Add event to log
- const char* logMsg = "testTpmLogReadSingleEntry";
- TCG_PCR_EVENT2 eventLog = addTestLogEvent(logMgr, logMsg);
+ uint8_t logMsg[] = "testTpmLogReadSingleEntry";
+ TCG_PCR_EVENT2 eventLog = addTestLogEvent(logMgr,
+ logMsg,
+ sizeof(logMsg));
// Retrive event from log
TCG_PCR_EVENT2 resultEventLog;
@@ -330,8 +337,8 @@ class TPMLogMgrTest: public CxxTest::TestSuite
getTestLogMgr(&logMgr);
// Add event to log
- const char* logMsg = "testTpmLogReadPastValidLog";
- addTestLogEvent(logMgr, logMsg);
+ uint8_t logMsg[] = "testTpmLogReadPastValidLog";
+ addTestLogEvent(logMgr, logMsg, sizeof(logMsg));
// Retrive event from log
TCG_PCR_EVENT2 resultEventLog;
@@ -389,9 +396,11 @@ class TPMLogMgrTest: public CxxTest::TestSuite
break;
}
+ uint8_t logMsg[] = "CalcLog11";
// Add an event to log
TCG_PCR_EVENT2 eventLog = addTestLogEvent(logMgr,
- "CalcLog11");
+ logMsg,
+ sizeof(logMsg));
if (TpmLogMgr_calcLogSize(&logMgr) !=
TpmLogMgr_getLogSize(&logMgr) ||
((firstEventSize +
@@ -405,11 +414,13 @@ class TPMLogMgrTest: public CxxTest::TestSuite
break;
}
+ uint8_t logMsg1[] = "CalcLog3434";
// Add more events to log
for (int idx = 0; idx < 10; idx ++)
{
eventLog = addTestLogEvent(logMgr,
- "CalcLog3434");
+ logMsg1,
+ sizeof(logMsg1));
if (TpmLogMgr_calcLogSize(&logMgr) !=
TpmLogMgr_getLogSize(&logMgr))
{
@@ -460,11 +471,13 @@ class TPMLogMgrTest: public CxxTest::TestSuite
}
+ uint8_t logMsg[] = "CalcLog3434";
// Add more events to log
for (int idx = 0; idx < 10; idx ++)
{
eventLog = addTestLogEvent(logMgr,
- "CalcLog3434");
+ logMsg,
+ sizeof(logMsg));
}
err = TpmLogMgr_initializeUsingExistingLog(&cloneMgr,
@@ -484,8 +497,9 @@ class TPMLogMgrTest: public CxxTest::TestSuite
break;
}
+ uint8_t logMsg1[] = "Clone123 23434";
// Now try adding an event to the clone logMgr
- eventLog = addTestLogEvent(cloneMgr, "Clone123 23434");
+ eventLog = addTestLogEvent(cloneMgr, logMsg1, sizeof(logMsg1));
if (TpmLogMgr_getLogSize(&logMgr) ==
TpmLogMgr_getLogSize(&cloneMgr))
{
diff --git a/src/usr/secureboot/trusted/test/trustedbootTest.H b/src/usr/secureboot/trusted/test/trustedbootTest.H
index 8c1655dd8..cbf221e57 100755
--- a/src/usr/secureboot/trusted/test/trustedbootTest.H
+++ b/src/usr/secureboot/trusted/test/trustedbootTest.H
@@ -792,6 +792,7 @@ class TrustedBootTest: public CxxTest::TestSuite
for (size_t i = 0; i < EXTEND_PCR_TESTS; ++i) {
+ uint8_t l_logMsg[] = "testExtendPCR: test";
num_ops++;
pcrExtendSingleTpm(pTpm,
PCR_DEBUG,
@@ -799,7 +800,8 @@ class TrustedBootTest: public CxxTest::TestSuite
TPM_ALG_SHA256,
digest,
TPM_ALG_SHA256_SIZE,
- "testExtendPCR: test");
+ l_logMsg,
+ sizeof(l_logMsg));
auto hwasState = pTpm->getAttr<TARGETING::ATTR_HWAS_STATE>();
if(!hwasState.functional)
OpenPOWER on IntegriCloud