diff options
author | Kees Cook <keescook@chromium.org> | 2012-08-01 15:32:11 -0700 |
---|---|---|
committer | Randall Spangler <rspangler@chromium.org> | 2012-08-06 10:08:01 -0700 |
commit | 6105497c043c6948085941c537275e1ab46bd3f0 (patch) | |
tree | 1062197b2bb54670dac1b134c14292998b400e72 | |
parent | c776787e254d9f389e7bf6eaeffb38ded14d6596 (diff) | |
download | vboot-6105497c043c6948085941c537275e1ab46bd3f0.tar.gz |
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 <keescook@chromium.org>
(cherry picked from commit 41282f1bbbf3a5dd75055d99194d15aa98b67242)
Change-Id: I1164ab236dcb467ba78b65aa9dc3b9552529a4ef
Reviewed-on: https://gerrit.chromium.org/gerrit/29282
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r-- | firmware/lib/tpm_lite/mocked_tlcl.c | 19 |
1 files changed, 18 insertions, 1 deletions
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; +} |