diff options
author | Kees Cook <keescook@chromium.org> | 2012-08-01 15:32:11 -0700 |
---|---|---|
committer | Gerrit <chrome-bot@google.com> | 2012-08-02 10:02:57 -0700 |
commit | 41282f1bbbf3a5dd75055d99194d15aa98b67242 (patch) | |
tree | cc49e2b1626af4142cf5ce00c7298e65ffbbe3e8 | |
parent | 7c3a486d6de63fd1c8c8e55adf5ec3aa2dcd65aa (diff) | |
download | vboot-41282f1bbbf3a5dd75055d99194d15aa98b67242.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
Change-Id: I9d71e49ec6c98e74954a17849ca82bf948d78ff2
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28982
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
Reviewed-by: Taylor Hutt <thutt@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; +} |