Commit Graph

22 Commits

Author SHA1 Message Date
Gabe Black
ac8805e7e9 Get rid of some crufty macros.
These were macros that were never used, or that were only set to one thing and
could be substituted up front.

I left in code guarded by the HAVE_ENDIAN_H and HAVE_LITTLE_ENDIAN macros even
though those are never defined because they guard a reportedly significantly
faster implementation of some functionality, at least according to a comment
in the source. It would be a good idea to enable that code path and see if it
really does make a big difference before removing it entirely.

BUG=None
TEST=Built for Link, Daisy, and the host with FEATURES=test. Built depthcharge
for Link and booted in normal mode.
BRANCH=None

Change-Id: I934a4dd0da169ac018ba07350d56924ab88b1acc
Signed-off-by: Gabe Black <gabeblack@google.com>
Reviewed-on: https://gerrit.chromium.org/gerrit/45687
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Gabe Black <gabeblack@chromium.org>
Tested-by: Gabe Black <gabeblack@chromium.org>
2013-03-19 16:55:44 -07:00
Kees Cook
8b6da26a6e tlcl: add GetOwner command
Since the "ownership" permament flag does not indicate if the TPM is
currently owned, the state of TPM Ownership must be read via a Capability
read of TPM_CAP_PROP_OWNER. This adds the "getownership" function.

BUG=chromium-os:22172
TEST=x86-alex build & manual test

Change-Id: I2fc9e933e891ba40190d008436b22496dced1c93
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/24784
Reviewed-by: Will Drewry <wad@chromium.org>
2012-06-13 14:22:12 -07:00
Kees Cook
f0605cbdc3 tpm_lite: implement TPM_GetRandom
Provide TPM_GetRandom function to library callers.

BUG=chromium-os:22172
TEST=lumpy build & manual testing

Change-Id: Id604fd92490ba697033158a580b0b4df1d975932
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/17120
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
2012-03-01 15:25:31 -08:00
Kees Cook
946370d012 tpmc: add PCR reading function
Add ability to report a single PCR value via the tpmc utility. Using
/sys/devices/platform/tpm_tis/pcrs is too slow, since it reads all
PCRs before returning. Anything wanting to read PCR0 on a time-critical
path needs maximum speed.

BUG=chromium-os:22172
TEST=install and test x86-alex.

Change-Id: I2d450961d33fa314d54b909135a74aa756279ec6
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/13891
Reviewed-by: Luigi Semenzato <semenzato@chromium.org>
2012-01-09 15:00:52 -08:00
Luigi Semenzato
050785c312 Bump tlcl_structures.h.
Change-Id: I9346c02244246b82cc6fe7c60090173ff650efc1

BUG=chromium-os:433
TEST=none

Review URL: http://codereview.chromium.org/6667050
2011-03-16 11:24:35 -07:00
Rong Chang
baa3bbe7a5 Move tpm lite API to common include path
In order to run test cases in both Linux user mode and u-boot command
mode. The API header tlcl.h must be accessed by both ebuilds.

Change-Id: Ic027dc118f26666b88bf54c511e2455a55e4eb8f

BUG=chromium-os:10497
TEST=emerge vboot_reference-firmware successfully

Review URL: http://codereview.chromium.org/6469089
2011-02-23 10:41:38 +08:00
Che-Liang Chiou
5d9509cbde vboot TPM stub functions return error codes
TlclStubInit, TlclCloseDevice, and TlclOpenDevice were void functions but
should return error codes.

BUG=chromium-os:6695
TEST=RUNTESTS=1 make && emerge successfully

Review URL: http://codereview.chromium.org/5796005

Change-Id: I8ddbf8b1f080d98ff6ed42c4a675fbda5b17eef1
2010-12-16 14:11:17 +08:00
Che-Liang Chiou
89678602e6 Fix integration bugs (vboot side)
BUG=chromium-os:8621
TEST=See below

1. Build and run tests of vboot (including linktest)
$ make && make runtests

2. Check if *_stub.o are not in vboot_fw.a
$ nm /build/<board>/usr/lib/vboot_fw.a | grep _stub.o

3. Build and boot x86-generic image
$ ./build_packages --board=x86-generic && ./build_image --board=x86-generic
(Then successfully boot the image you just built)

See CL=4372001 for u-boot side changes

Review URL: http://codereview.chromium.org/4266002

Change-Id: Icc2bcc551c998f370e4b737fbe442ebf029cd81c
2010-11-09 08:33:36 +08:00
Luigi Semenzato
a7e19cffbe Add new files: two tests, one common file, one program to set things up.
Change-Id: I4c9b7a937103f3978cbed6629ee4057018b80eae

More cleanup.  Also allow some tests to run even when TPM is already started.

Change-Id: I23558b96a1de55bbeca42dbf2e44f6802a0ec85b

Reorganize and standardize behavior of tests.

Change-Id: Id32fd09211a72deaa66a3dd0f973d35506ff96f2

BUG=433
TEST=ran all the tests I could run without TPM-free BIOS

Review URL: http://codereview.chromium.org/3389004
2010-09-15 17:20:36 -07:00
Randall Spangler
528f6a20db fix missing constant
Change-Id: I26d7d725cb429394e24be40a2f362b7ff160f4ee

BUG=none
TEST=make && make runtests (and build into test BIOS)

Review URL: http://codereview.chromium.org/3337017
2010-09-08 16:40:14 -07:00
Randall Spangler
1fe1607679 TBR: reviewed in person with semenzato 2010-09-02 11:37:51 -07:00
Luigi Semenzato
89a02c194f Make TPM datagrams const, since they cannot be modified in the RO firmware.
Change-Id: I7f135584536c7437824ae65f74a8f7ef27c28665

BUG=
TEST=

Review URL: http://codereview.chromium.org/3271006
2010-08-31 15:49:56 -07:00
Luigi Semenzato
3da063e3f7 Add resume command (TPM_Startup(ST_STATE))
Change-Id: Ia85c3cdbcb74c6cd8e7bd53c51eaccc98b13677e

BUG=
TEST=

Review URL: http://codereview.chromium.org/3232006
2010-08-31 14:31:30 -07:00
Luigi Semenzato
377557fcb2 Add physical presence initialization and locking to one-time initializations.
Change-Id: If2b6041fe93bc97885e45bbb0cf7e1b81cb06c18

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3229011
2010-08-31 13:20:53 -07:00
Luigi Semenzato
1d83dd1ba5 Add a command to enable the physical presence command.
Change-Id: Id8b6ac3c75d1ee34237cde8adde55cea33b25889

Review URL: http://codereview.chromium.org/3163045
2010-08-30 10:23:43 -07:00
Luigi Semenzato
5896b9664d Added new commands and reactivated full rebuild after fixing for ARM ebuild.
Review URL: http://codereview.chromium.org/3116025

Change-Id: Ideb82562f6b1c3ce5cd9e0b79de250d0a7bd976e
2010-08-25 07:16:03 -07:00
Randall Spangler
4abede35af Add structs for TPM NV simplification. Now uses only 2 NV spaces, one for firmware and one for kernel.
Changed TlclRead / TlclWrite to take void* / const void* to reduce typecasts.

Much restructuring of rollback_index.c.

Fixed a version-packing bug in rollback_index.c (& --> |)

BUG:chrome-os-partner:304
TEST:manual testing of all code flows on CRB

Review URL: http://codereview.chromium.org/3084030
2010-08-12 16:40:32 -07:00
Luigi Semenzato
e72291c636 Command-line utility to execute TPM commands bypassing the TSS stack.
Review URL: http://codereview.chromium.org/3149001
2010-08-10 09:46:09 -07:00
Randall Spangler
205190d4ae Pay attention to TPM communication errors
BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/3078028
2010-08-05 15:55:06 -07:00
Gaurav Shah
553d00ec86 (In the right repository this time.)
Do not directly manipulate global structs. Work on the local copy instead.

In firmware-land, globals are a bad idea.

Review URL: http://codereview.chromium.org/3027011
2010-07-19 19:22:10 -07:00
Randall Spangler
3e1081fb71 Add lots of debugging to TPM library.
Temporarily disable TPM in developer mode.

Review URL: http://codereview.chromium.org/3041005
2010-07-19 10:04:21 -07:00
Randall Spangler
39f66114c0 Add tpm lite to vboot reference
Review URL: http://codereview.chromium.org/2919010
2010-07-14 09:10:23 -07:00