diff options
author | Meng-Huan Yu <menghuan@google.com> | 2018-10-19 21:03:35 +0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-01 02:17:42 -0700 |
commit | 737e34e377dfb547e64c278470a224bfcde3b97c (patch) | |
tree | f81d8d509233a74ba142ea66662e3eb9adc8e67d /tests | |
parent | 7283689dbd93502519edf47199b203b62da46ec1 (diff) | |
download | vboot-737e34e377dfb547e64c278470a224bfcde3b97c.tar.gz |
tpmc: Add TlclUndefineSpace/Ex for TPM 1.2/2.0
For TPM 1.2, to undefine the space is just define a size 0 space.
And all operation should be done under physical presence is set
if NvLocked is set. Iirc, NvLocked is usually set before boot.
For TPM 2.0, support to undefine space regardless platform hierarchy
state. We will use platform authorization when TPMA_NV_PLATFORMCREATE
of that space is set. Otherwise, we will try to use owner
authorization with NULL password.
For owner authorization with customized password is still not
supported in UndefineSpace since it is also not support in
DefineSpaceEx.
BUG=chromium:895549
BRANCH=None
TEST=vboot_reference unit test passed and added new link test for TPM 1.2.
For TPM 2.0, there is no unit test, but passed manually test
with tpmc in the following commit.
Also passed depthcharge unit test for TPM 2.0 and TPM 1.2 board.
Change-Id: I06dcc70c63a88a04d19f3b248666ff2492a1d2b0
Reviewed-on: https://chromium-review.googlesource.com/1291131
Commit-Ready: Meng-Huan Yu <menghuan@chromium.org>
Tested-by: Meng-Huan Yu <menghuan@chromium.org>
Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tlcl_tests.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/tlcl_tests.c b/tests/tlcl_tests.c index 9d67671e..385350dd 100644 --- a/tests/tlcl_tests.c +++ b/tests/tlcl_tests.c @@ -241,6 +241,11 @@ static void ReadWriteTest(void) TEST_EQ(calls[0].req_cmd, TPM_ORD_NV_DefineSpace, " cmd"); ResetMocks(); + TEST_EQ(TlclUndefineSpace(1), 0, "UndefineSpace"); + // TPM1.2 use TPM_ORD_NV_DefineSpace with size 0 to delete space + TEST_EQ(calls[0].req_cmd, TPM_ORD_NV_DefineSpace, " cmd"); + + ResetMocks(); TEST_EQ(TlclSetNvLocked(), 0, "SetNvLocked"); TEST_EQ(calls[0].req_cmd, TPM_ORD_NV_DefineSpace, " cmd"); |