summaryrefslogtreecommitdiff
path: root/tests/tlcl_tests.c
diff options
context:
space:
mode:
authorMattias Nissler <mnissler@chromium.org>2019-02-21 10:25:02 +0100
committerchrome-bot <chrome-bot@chromium.org>2019-02-27 04:59:14 -0800
commit0e9bab362524168cea66476cd418322b9587a5f0 (patch)
tree9de3fd5fb10dbc886b01e9f7a3508223f41b074c /tests/tlcl_tests.c
parent348132bf4746058d87ec6d6c6cc7bd90c8ca3738 (diff)
downloadvboot-0e9bab362524168cea66476cd418322b9587a5f0.tar.gz
tpm_lite: Fix delegation table parsing
The computation to determine the number of table entries was incorrect due to sizeof(TPM_FAMILY_TABLE_ENTRY) producing a wrong value for the size of a single entry. TPM_FAMILY_TABLE_ENTRY actually doesn't match the encoding of the entries in the TPM's response due to alignment. Fix this by using a constant that reflects the correct entry size. Relatedly, I found that ReadDelegationFamilyTableTest would have caught the bug, but was actually not being invoked. Fix this as well. BUG=chromium:934193 TEST=Unit tests, manual per instructions in bug. BRANCH=none Change-Id: Ic72ad110dc0dbf15cc3cc25b438c4bc2bd2d6015 Reviewed-on: https://chromium-review.googlesource.com/1480519 Commit-Ready: Mattias Nissler <mnissler@chromium.org> Tested-by: Mattias Nissler <mnissler@chromium.org> Tested-by: Andreea-Elena Costinas <acostinas@google.com> Reviewed-by: Andrey Pronin <apronin@chromium.org>
Diffstat (limited to 'tests/tlcl_tests.c')
-rw-r--r--tests/tlcl_tests.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/tlcl_tests.c b/tests/tlcl_tests.c
index 385350dd..00eae615 100644
--- a/tests/tlcl_tests.c
+++ b/tests/tlcl_tests.c
@@ -1168,6 +1168,7 @@ int main(void)
IFXFieldUpgradeInfoTest();
ReadPubekTest();
TakeOwnershipTest();
+ ReadDelegationFamilyTableTest();
return gTestSuccess ? 0 : 255;
}