aboutsummaryrefslogtreecommitdiff
path: root/Entity.c
AgeCommit message (Collapse)Author
2015-08-21Call marshal functions with correct buffer size.Jocelyn Bohr
CL:289647 removed instances of calling marshal functions with size as NULL. This is correct, but the buffer size was not computed correctly in some instances, causing data to not be marshaled. TEST=build tpm2, tpm2-simulator, and trunks, and deploy to DUT On a DUT: $ sudo tpm2-simulator // in one terminal $ sudo trunksd --simulator // in another terminal $ trunks_client --clear // in a third terminal $ trunks_client --own --owner_password="" $ trunks_client --regression_test Trunks is able to take ownership of the software TPM, as well as pass a few regression tests. Prior to this change, trunks failed on taking ownership. BUG=none Change-Id: I46e3a5a30307c832405cc7f91623f87cbece0cb9 Reviewed-on: https://chromium-review.googlesource.com/294883 Tested-by: Jocelyn Bohr <bohr@chromium.org> Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org> Commit-Queue: Jocelyn Bohr <bohr@chromium.org>
2015-07-30Remove instances of calling marshal functions with NULL pointer.Jocelyn Bohr
In the code scraped from the TCG TPM2.0 Library specification, there are several instances where the intent is to marshal data into a buffer, but NULL pointer is passed in as size. Part 4 section 4.2.3.1 states: "If size is a NULL pointer, then no data is marshaled and the routine will compute the size of the memory required to marshal the indicated type." Implying these usages are bugs. This CL removes all instances of passing in NULL as size to a Marshal function when the intent is to marshal data. TEST=$ sudo emerge tpm2 builds libtpm2.a. Currently this is the only test we have for the scraped code. BUG=none Change-Id: If7b2a60f6a8e875b4a6eceab513dc22325bf4999 Reviewed-on: https://chromium-review.googlesource.com/289647 Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org> Commit-Queue: Jocelyn Bohr <bohr@chromium.org> Tested-by: Jocelyn Bohr <bohr@chromium.org>
2015-06-03Changes to allow compilation of Entity.cVadim Bendebury
BUG=none TEST=compilation succeeds: cc -Wall -Werror -c -o /dev/null Entity.c Change-Id: Ia1734dd483639176d37e8a204f9be81ea510df60 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/274177 Reviewed-by: Utkarsh Sanghi <usanghi@chromium.org>
2015-05-20Initial commit to seed TPM2.0 source code directoryVadim Bendebury
LICENSE file text copied from TCG library specification. README describes the procedure used to extract source code from parts 3 and 4 of the specification. The python scripts and part{34}.txt files will be removed in the following commits. Change-Id: Ie281e6e988481831f33483053455e8aff8f3f75f Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>