chromiumos/platform/trunks.git
8 months agoAdd TCS context handling. 11/65711/7 master
Sarah Harvey [Tue, 13 Aug 2013 17:13:53 +0000 (10:13 -0700)]
Add TCS context handling.

The TSS specification defines a TCS layer that facilitates communication
between the TPM and the TSP. The TCS layer also requires context similar to
that of the TCS.
The following has been implemented:
 - context management (creation, deletion)
 - context resource management
Unit tests are also provided testing these two things.

BUG=chromium:254742
TEST=Compiles successfully and passes unit tests.

Change-Id: I73510d50f922e1a2ce70037e43067f717d8310f3
Reviewed-on: https://gerrit.chromium.org/gerrit/65711
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
8 months agoRefactor TSP contexts and context manager into more generic classes. 60/65960/6
Sarah Harvey [Thu, 15 Aug 2013 16:49:45 +0000 (09:49 -0700)]
Refactor TSP contexts and context manager into more generic classes.

The TCS and TSP share some commonalities, including the fact that they both
make use of a context manager and contexts. In an effort to de-duplicate code,
context and context manager classes have been refactored to be more generic.
The appropriate unit tests have also been refactored accordingly.

BUG=chromium:254742
TEST=Compiles successfully and passes unit tests.

Change-Id: Ib771da7a248f0200c5ac356a668b22db03dfdf18
Reviewed-on: https://gerrit.chromium.org/gerrit/65960
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
8 months agoAdd TPM and TPM message classes to trunks. 32/65232/13
Sarah Harvey [Thu, 8 Aug 2013 20:14:30 +0000 (13:14 -0700)]
Add TPM and TPM message classes to trunks.

This CL adds a TPM class that provides nicer helper functions for talking to
the TPM device, along with a TPM message class that handles all the formatting,
endian-correction, etc. The TPM class then invokes Send() and Recv() on TPM
messages to facilitate communication with the TPM device.

BUG=chromium:254742
TEST=Compiles successfully and passes unit tests.

Change-Id: I742362da946ae4f38b7d19c76353cc4794c4567d
Reviewed-on: https://gerrit.chromium.org/gerrit/65232
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
Reviewed-by: Sarah Harvey <saharvey@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
8 months agoSet TSP to use TSS error handling mechanisms. 53/65653/2
Sarah Harvey [Tue, 13 Aug 2013 01:06:15 +0000 (18:06 -0700)]
Set TSP to use TSS error handling mechanisms.

Now that we have TSS error handling mechanisms, the TSP can use these
mechanisms.

BUG=chromium:254742
TEST=Compiles successfully and passes unit tests.

Change-Id: I7c76a5ac8c6df42a3952169cd8e52aaf77809419
Reviewed-on: https://gerrit.chromium.org/gerrit/65653
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
8 months agoAdd TSS error handling. 04/63304/8 release-R30-4537.B
Sarah Harvey [Thu, 25 Jul 2013 00:46:01 +0000 (17:46 -0700)]
Add TSS error handling.

The TSS specification defines many return codes for the different components of
the TSS: TSP, TCS, TDDL, TPM. In order to adequately handle and log errors in
each subsystem, the following utility functions are needed:
 - Appropriate bits set in the return codes to identify which subsystem
     generated the error.
 - Conversion from numeric return codes to human-readable messages for logging
     purposes.

Some additional macros have been added to the TSS header files that were
present in the specification, but not the header files.

BUG=chromium:254742
TEST=Compiles successfully and passes unit tests.

Change-Id: Ie59237d9748c34b914dddc22594b418389491e23
Reviewed-on: https://gerrit.chromium.org/gerrit/63304
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
Reviewed-by: Sarah Harvey <saharvey@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
8 months agoMakefile fixed to add gtest deps correctly. 41/65041/2
Darren Krahn [Thu, 8 Aug 2013 00:14:13 +0000 (17:14 -0700)]
Makefile fixed to add gtest deps correctly.

Also, tss set as the only default target.

BUG=none
TEST=build with emerge, with 'make', and with cros_workon_make

Change-Id: I20376f3a26f7218f2d98cf8d1d93880ec5bd6e63
Reviewed-on: https://gerrit.chromium.org/gerrit/65041
Reviewed-by: Sarah Harvey <saharvey@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
8 months agoAdd TSP context handling. 29/60829/9 factory-pit-4471.B firmware-pit-4482.B stabilize-4512.B
Sarah Harvey [Wed, 3 Jul 2013 00:20:37 +0000 (17:20 -0700)]
Add TSP context handling.

The TSS specification defines a TSP layer that is accessible through a C API.
Each connection the TSP makes to the TCS requires a context, thus context
handling is needed before any other functions are implemented.

The following has been implemented:
 - context management (creation, deletion)
 - context resource management

Unit tests are also provided testing these two things.

BUG=chromium:254742
TEST=Compiles successfully and passes unit tests.

Change-Id: I52fe88764a6fd53375bc98181d4b730e891c6c32
Reviewed-on: https://gerrit.chromium.org/gerrit/60829
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
9 months agoImplemented dbus service and client skeletons. 43/61343/3 factory-4455.B stabilize-4443.B
Darren Krahn [Tue, 9 Jul 2013 20:44:28 +0000 (13:44 -0700)]
Implemented dbus service and client skeletons.

BUG=chromium:254742
TEST=manual, unit

Change-Id: Id3ef01952bdcebc0c052883d287d4119b2ecb5e9
Reviewed-on: https://gerrit.chromium.org/gerrit/61343
Commit-Queue: Darren Krahn <dkrahn@chromium.org>
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Darren Krahn <dkrahn@chromium.org>
9 months agoUpdate TSS 1.2 headers so they may be installed in tss/ , 78/60678/6 factory-pit-4390.B firmware-falco_peppy-4389.B firmware-leon-4389.26.B firmware-wolf-4389.24.B
Sarah Harvey [Mon, 1 Jul 2013 20:01:07 +0000 (13:01 -0700)]
Update TSS 1.2 headers so they may be installed in tss/ ,

TSS headers provided by TrouSerS is installed in tss/ . This CL modifies
the TSS 1.2 headers provided by Trunks such that they may be installed in tss/ .

Minor change: changing CRLF->LF.

BUG=chromium:254742
TEST=Compiles and tests successfully.

Change-Id: Ia9e510778eac18e14241240b287a0370758cefcf
Reviewed-on: https://gerrit.chromium.org/gerrit/60678
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>

9 months agoAdd TSS 1.2 headers to new trunks. 30/60130/7
Sarah Harvey [Wed, 26 Jun 2013 18:31:17 +0000 (11:31 -0700)]
Add TSS 1.2 headers to new trunks.

The TSS replacement trunks currently depends on the TSS headers in TrouSerS,
which are out of date. This CL provides the latest version for use in trunks.

BUG=chromium:254742
TEST=Compiles and tests successfully.

Change-Id: Ia4f41c30a67dec919f717b53883ee539f8faea92
Reviewed-on: https://gerrit.chromium.org/gerrit/60130
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>

9 months agoAdding skeleton project for new TSS implementation. 03/60003/4
Sarah Harvey [Tue, 25 Jun 2013 21:58:23 +0000 (14:58 -0700)]
Adding skeleton project for new TSS implementation.

We want to create our own TSS implementation to replace TrouSerS in
Chrome OS. It will be built on top of already-existing trunks code. Until the
project becomes more polished, it will currently reside in a subdirectory
trunks/tss/ .

Code being committed currently consists of the following:
 - a minimal Makefile
 - a common.mk
 - function stubs for the TSP interface (return TSS_E_NOTIMPL)
 - a silly test or two that tests two stubs for TSS_E_NOTIMPL
 - modifications to the existing trunks Makefile to run make in tss/
   (so cros_workon_make works with the --test flag)

The TSS header files are currently being included from /usr/include/ with a
dependency on TrouSerS' copy of the tss headers. This may change sometime in
the near future to the latest version provided by the TCG.

BUG=chromium:254742
TEST=Compiles and successfully runs the two silly tests.

Change-Id: I1449737cac77db0bcc8af2391aa4bc2032db268d
Reviewed-on: https://gerrit.chromium.org/gerrit/60003
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Tested-by: Sarah Harvey <saharvey@chromium.org>
Commit-Queue: Sarah Harvey <saharvey@chromium.org>

11 months agoChange the generation strategy from code to type descriptors. 40/37040/3 factory-4128.B factory-4290.B factory-pit-4280.B factory-spring-4131.B factory-spring-4262.B release-R28-4100.B release-R29-4319.B stabilize-4068.0.B stabilize-4100.38.B stabilize-4255.B stabilize-4287.B stabilize-spring-4100.53.B toolchainB
Luigi Semenzato [Wed, 31 Oct 2012 18:54:59 +0000 (11:54 -0700)]
Change the generation strategy from code to type descriptors.

This changes the way marshalling/unmarshalling is done.
Previously the code generator would produce a C function
for each structure.  With this change, the layout of a
structure is encoded in an array of bytes, and a piece
of generic code traverses the array and performs the
required operations.

The main reason to do this is a reduced footprint, at the expense
of some marshal/unmarshal overhead (but the TPM is so slow that
the impact of this overhead should be negligible).

Version with generated marshallers:

semenzato@semenzato:~/trunks$ size tpmc
   text    data     bss     dec     hex filename
 188243    4172      48  192463   2efcf tpmc

version with interpreter-based marshalling:

semenzato@semenzato:~/trunks$ size tpmc
   text    data     bss     dec     hex filename
  64655    8404      48   73107   11d93 tpmc

Both of them contain the marshalling/unmarshalling code for all commands.
For a small subset of commands, the generated-code version is probably
still smaller, but the interpreted version is small enough that
this won't be a concern even in the firmware.

This change also adds the command TPM_GetTestResults.

BUG=chromium-os:19488
TEST=none

Change-Id: I2f5b30b480a0efcc4aa3db280aab20ec25681bab
Reviewed-on: https://gerrit.chromium.org/gerrit/37040
Reviewed-by: Darren Krahn <dkrahn@chromium.org>
Commit-Queue: Luigi Semenzato <semenzato@chromium.org>
Tested-by: Luigi Semenzato <semenzato@chromium.org>
2 years ago[trunks] add OWNERS 76/19776/1 factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B factory-2569.B factory-2717.B factory-2723.14.B factory-2846.B factory-2848.B factory-2914.B factory-2985.B factory-2993.B factory-3004.B factory-3536.B factory-spring-3842.B firmware-butterfly-2788.B firmware-link-2348.B firmware-link-2695.2.B firmware-link-2695.B firmware-parrot-2685.B firmware-snow-2695.90.B firmware-snow-2695.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B firmware-stout-2817.B release-R20-2268.B release-R21-2465.B release-R22-2723.B release-R23-2913.B release-R25-3428.B release-R26-3701.B release-R27-3912.B stabilize stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize-3658.0.0 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-3701.46.B stabilize-3701.81.B stabilize-3881.0.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-bluetooth-smart stabilize-daisy stabilize-link stabilize-link-2913.278 stabilize2 toolchain-3428.65.B toolchain-3701.42.B toolchainA
Elly Jones [Fri, 6 Apr 2012 19:32:28 +0000 (15:32 -0400)]
[trunks] add OWNERS

TEST=None
BUG=chromium-os:22007

Change-Id: I68d4a1f865ff6c0fb3e15167da041bcb7af6e4c7
Signed-off-by: Elly Jones <ellyjones@chromium.org>
2 years agoAdd dynamic library generation to Makefile. 71/8071/1 factory-1235.B factory-1284.B factory-1412.B factory-1987.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B release-R16-1193.B release-R17-1412.B release-R18-1660.B release-R19-2046.B
Luigi Semenzato [Wed, 21 Sep 2011 21:02:20 +0000 (14:02 -0700)]
Add dynamic library generation to Makefile.

Also fix a missing dependency, and add another ignored command.

BUG=None
TEST=ran "make" and nm on the resulting .so file.

Change-Id: Ib4f2777117b1c02b96f70832d2e490e66bcdfb31

2 years agoAdd unit test for structure and command parsing and generation 33/7433/3 factory-1020.B
Luigi Semenzato [Thu, 8 Sep 2011 22:28:05 +0000 (15:28 -0700)]
Add unit test for structure and command parsing and generation

This tests the parser and generator for the TPM structures and commands
by comparing input and output for a small case.

BUG=chromium-os:19488
TEST=ran "ttl-generator.py test"

Change-Id: Ie4edad43ce95af4c04d751164ba98ac5837d4fa5

2 years agoInitial version of trunks. This compiles and produces a running tpmc. 98/6798/8
Luigi Semenzato [Fri, 26 Aug 2011 22:52:04 +0000 (15:52 -0700)]
Initial version of trunks.  This compiles and produces a running tpmc.

BUG=chromium-os:19488
TEST=ran tpmc and successfully executed several plain and authorized commands

Change-Id: Iac692e7ae8b2fbff2af2cdf816b942883cf11352

2 years agoinit repo 71/6771/1 factory-980.B release-1011.B test-982.B
Luigi Semenzato [Fri, 26 Aug 2011 18:44:38 +0000 (11:44 -0700)]
init repo