Stub tlcl implementation for tpm2 case

Build a special version of TPM Lightweight Command Library in
libvboot_host for TPM2. Create the framework for implementation, stub
functions for now. libvboot_host is used by tpmc and other user-space
utilities that talk directly to tpm bypassing trunks/trousers.

BRANCH=none
BUG=chrome-os-partner:54981
BUG=chrome-os-partner:55210
TEST=Boot on kevin, verify that 'tpmc read' works.

Change-Id: I4cc41028041193041defc319687697eb9edb1f3e
Reviewed-on: https://chromium-review.googlesource.com/358623
Commit-Ready: Andrey Pronin <apronin@chromium.org>
Tested-by: Stephen Barber <smbarber@chromium.org>
Tested-by: Andrey Pronin <apronin@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
This commit is contained in:
Andrey Pronin
2016-07-06 19:10:46 -07:00
committed by chrome-bot
parent d5820a79fc
commit 1becb0dabe
6 changed files with 218 additions and 19 deletions

View File

@@ -353,8 +353,10 @@ uint32_t SetupTPM(int developer_mode, int disable_dev_request,
int clear_tpm_owner_request, RollbackSpaceFirmware* rsf)
{
uint8_t in_flags;
#ifndef TPM2_MODE
uint8_t disable;
uint8_t deactivated;
#endif
uint32_t result;
uint32_t versions;
@@ -396,6 +398,7 @@ uint32_t SetupTPM(int developer_mode, int disable_dev_request,
#endif
RETURN_ON_FAILURE(TlclContinueSelfTest());
#endif
#ifndef TPM2_MODE
result = TlclAssertPhysicalPresence();
if (result != TPM_SUCCESS) {
/*
@@ -417,6 +420,7 @@ uint32_t SetupTPM(int developer_mode, int disable_dev_request,
VBDEBUG(("TPM: Must reboot to re-enable\n"));
return TPM_E_MUST_REBOOT;
}
#endif
/* Read the firmware space. */
result = ReadSpaceFirmware(rsf);