From 6105497c043c6948085941c537275e1ab46bd3f0 Mon Sep 17 00:00:00 2001 From: Kees Cook Date: Wed, 1 Aug 2012 15:32:11 -0700 Subject: Add missing mocked TPM functions BUG=chromium-os:33110, chromium-os:33111, chromium-os:33112 TEST=alex build, "MOCK_TPM=1 make" links STATUS=Fixed Original-Change-Id: I9d71e49ec6c98e74954a17849ca82bf948d78ff2 Signed-off-by: Kees Cook (cherry picked from commit 41282f1bbbf3a5dd75055d99194d15aa98b67242) Change-Id: I1164ab236dcb467ba78b65aa9dc3b9552529a4ef Reviewed-on: https://gerrit.chromium.org/gerrit/29282 Reviewed-by: Randall Spangler Tested-by: Randall Spangler --- firmware/lib/tpm_lite/mocked_tlcl.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/firmware/lib/tpm_lite/mocked_tlcl.c b/firmware/lib/tpm_lite/mocked_tlcl.c index 790274f5..5c9c4cbd 100644 --- a/firmware/lib/tpm_lite/mocked_tlcl.c +++ b/firmware/lib/tpm_lite/mocked_tlcl.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2011 The Chromium OS Authors. All rights reserved. +/* Copyright (c) 2012 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -45,6 +45,11 @@ uint32_t TlclRead(uint32_t index, void* data, uint32_t length) { return TPM_SUCCESS; } +uint32_t TlclPCRRead(uint32_t index, void* data, uint32_t length) { + Memset(data, '\0', length); + return TPM_SUCCESS; +} + uint32_t TlclWriteLock(uint32_t index) { return TPM_SUCCESS; } @@ -130,3 +135,15 @@ uint32_t TlclGetPermissions(uint32_t index, uint32_t* permissions) { *permissions = 0; return TPM_SUCCESS; } + +uint32_t TlclGetOwnership(uint8_t* owned) { + *owned = 0; + return TPM_SUCCESS; +} + +uint32_t TlclGetRandom(uint8_t* data, uint32_t length, uint32_t *size) { + *size = length; + /* http://dilbert.com/strips/comic/2001-10-25/ */ + Memset(data, '\x9', *size); + return TPM_SUCCESS; +} -- cgit v1.2.1