From 416bdc680c53c153187e85eb1ed949e40ca1231a Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 6 May 2013 15:13:10 -0700 Subject: tpmc: Fix compilation with MOCK_TPM=1 The tpmc utility is failing to build with: MOCK_TPM=1 emerge vboot_reference Because some functions are not exported by the mocked_tlcl library. This commit adds mocked functions for TlclPacketSize() and TlclSendReceive() BUG=chrome-os-partner:19263 BRANCH=none TEST=manual: MOCK_TPM=1 emerge-fox_wtm2 vboot_reference Change-Id: Iaf4c2dff78272c41572e3b89444346a03be35fbe Signed-off-by: Duncan Laurie Reviewed-on: https://gerrit.chromium.org/gerrit/50225 Reviewed-by: Aaron Durbin --- firmware/lib/tpm_lite/mocked_tlcl.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/firmware/lib/tpm_lite/mocked_tlcl.c b/firmware/lib/tpm_lite/mocked_tlcl.c index 2657cb63..627ed667 100644 --- a/firmware/lib/tpm_lite/mocked_tlcl.c +++ b/firmware/lib/tpm_lite/mocked_tlcl.c @@ -153,3 +153,16 @@ uint32_t TlclGetRandom(uint8_t* data, uint32_t length, uint32_t *size) { Memset(data, '\x9', *size); return TPM_SUCCESS; } + +int TlclPacketSize(const uint8_t* packet) +{ + uint32_t size; + FromTpmUint32(packet + sizeof(uint16_t), &size); + return (int) size; +} + +uint32_t TlclSendReceive(const uint8_t* request, uint8_t* response, + int max_length) +{ + return TPM_SUCCESS; +} -- cgit v1.2.1