Commit Graph

39 Commits

Author SHA1 Message Date
mukesh agrawal
a7b9481f34 Revert "Verified boot wrapper - replace utility functions"
This reverts commit bd81b3a7d3.

Change-Id: I2be2c076a37bf0e49569248691fceac417254f0b
Reviewed-on: http://gerrit.chromium.org/gerrit/3295
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
2011-06-27 20:02:36 -07:00
Randall Spangler
bd81b3a7d3 Verified boot wrapper - replace utility functions
This is part 3 of the vboot wrapper API refactoring.  It replaces the
function calls to utility.c functions with new API calls.  (It also
fixes up some integer type mismatches in cryptolib that were causing
warnings on the H2C build; those had been fixed a while ago in H2C but
hadn't been propagated across.)

BUG=chromium-os:17006
TEST=make && make runtests

Change-Id: I771085dcdf79d9592de64f35e3b758111a80dd9f
Reviewed-on: http://gerrit.chromium.org/gerrit/3263
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 14:57:50 -07:00
Luigi Semenzato
7b90cf3f00 Tolerate lack of TPM reset in common cases.
This is a temporary workaround for Tegra boards that don't reset the TPM
when the CPU is reset.  It makes the firmware more lenient when execution
starts with an already locked TPM.

BUG=chromeos-partner:3574
TEST=none (yet)

Change-Id: If6a060595c1eb41e95e0935f8467de8bb6256b12
Reviewed-on: http://gerrit.chromium.org/gerrit/1429
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
2011-05-25 17:21:13 -07:00
Randall Spangler
5ac39bfff0 Add TPM version checking
Change-Id: Ic32b7bcf0bc5501e21dc84e79419a256d9b0d095

R=semenzato@chromium.org,reinauer@chromium.org
BUG=chrome-os-partner:2832
TEST=manual

crossystem tpm_fwver tpm_kernver
On a debug system, this will return 0x00010001 0x00010001

Review URL: http://codereview.chromium.org/6685075
2011-03-17 17:58:56 -07:00
Luigi Semenzato
83c3714ed3 Perform a full self test before one-time initialization.
Change-Id: I2f5232d5133c0725ec21f885a4632e980062be8f

BUG=chrome-os-partner: 1826
TEST=none

Review URL: http://codereview.chromium.org/6688004
2011-03-17 10:33:41 -07:00
Luigi Semenzato
06fbb168ac Move ContinueSelfTest to a later point to save time.
Change-Id: I96b413438359e11315101d408033066e6f0a0981

BUG=chrome-os-partner: 1826
TEST=none

Review URL: http://codereview.chromium.org/6667051
2011-03-16 17:33:23 -07:00
Randall Spangler
4c6e6dac28 Fix compiler errors on MSVC
Change-Id: I47fd6d0be5542e5f540a34410b3f694ae0f67fd9

R=gauravsh@chromium.org
BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6676039
2011-03-16 09:56:15 -07:00
Gaurav Shah
b64faaa7f4 Update PCR state with the state of the firmware keyblock flags too.
I re-factored the extend call into its own module, since it doesn't necessarily
need to be couple with rollbackfirmwaresetup.

BUG=chrome-os-partner:2372
TEST=Tried emerge-x86-generic and emerge-arm-generic vboot_reference.

Change-Id: I0d3115b10b686133e63e304570325ebdbd50ae3a

Review URL: http://codereview.chromium.org/6696006
2011-03-15 16:36:29 -07:00
Randall Spangler
c324fbfb6d Only advance kernel version when the booted partition has a valid key block
Change-Id: I879c18cc139f8a02bcaa6eb80437eaf836a5e851

BUG=chrome-os-partner:2597
TEST=manual

install pvt-signed image
flip dev switch on and boot
install dev-signed firmware
reboot
reboot
sudo bash
stop tcsd
tpmc read 0x1008 0x0d

bytes 6-10 should be 1 0 1 0, not FF FF FF FF

Review URL: http://codereview.chromium.org/6626020
2011-03-04 12:19:25 -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
Randall Spangler
44f34b5195 Port over ContinueSelfTest() fix from firmware
Change-Id: Ib12405f968af11ad75a6429ae9ebe502dde5bf92

BUG=chrome-os-partner:1591
TEST=make && make runtests

(This is already in the firmware; I'm just copying it back into vboot reference)

Review URL: http://codereview.chromium.org/5312003
2010-11-23 14:17:21 -08:00
Gaurav Shah
82602d7909 Change PCR extend call to capture the state of both recovery and dev modes
Change-Id: I3f18081bda888a0fa6f56a67d0cef17268014706

BUG=chromium-os:6714
TEST=manual by enabling ROLLBACK_TPM in firmware/Makefile (did not test by compiling under MSVC)

Review URL: http://codereview.chromium.org/3973001
2010-10-21 14:40:38 -07:00
Randall Spangler
3e2c742be4 This enables a normal recovery mode image to fix problems with the TPM.
Change-Id: I8260d9596640e79af24c02ca1da5b47eb2caeaa7

BUG=chrome-os-partner:1439
TEST=manual

Review URL: http://codereview.chromium.org/3847005
2010-10-18 16:43:19 -07:00
Luigi Semenzato
26718cad62 Move initialization of g_recovery_mode.
Change-Id: I876b1f366eeb5d73eb3b3998a76ee5e1d386c7f5

BUG=chrome-os-partner:1182
TEST=none

Review URL: http://codereview.chromium.org/3470013
2010-09-24 12:50:45 -07:00
Luigi Semenzato
5be730cbf1 Fix (unfiled, I think) TPM initialization bug.
Change-Id: Id083f73680dbb1edd9ba036659b57f77b16325ec

BUG=none
TEST=none
TBR=rspangler@chromium.org
2010-09-23 17:05:12 -07:00
Randall Spangler
6eee220fcd Fix one-time init
Change-Id: Ie8b4f5b1b7493b16b69eb41531ec3362d4b3679f

BUG=chrome-os-partner:1101
TEST=manual testing of affected TPM on CRB

Review URL: http://codereview.chromium.org/3388008
2010-09-15 15:57:58 -07:00
Randall Spangler
7c88d4c31d use continue self test
Change-Id: I4785a6326017c63d83a8eb153d6b90ee82e5f839

BUG=chromeos-partner:222
TEST=manual (build FW, make sure system boots and tpmc prints good values)

Review URL: http://codereview.chromium.org/3367020
2010-09-09 11:14:59 -07:00
Luigi Semenzato
9828594eaa Bail out from S3Resume if TPM was not power-cycled.
Change-Id: I80027a5a935e13ba37e24978dd4b0c6040d66728

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3298010
2010-09-07 09:56:19 -07:00
Randall Spangler
1fe1607679 TBR: reviewed in person with semenzato 2010-09-02 11:37:51 -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
Gaurav Shah
2447dd256f Add a PCR extend call for measuring the dev mode boot flag.
BUG=2083
TEST=manual

Compiled with DISABLE_ROLLBACK unset. I need help testing this change - in particular, if the PCR 0 value is actually different in dev mode off vs. dev mode on. This can be done by invoking 'tpm_pcrread -p 0' at the shell. tpm_pcrread is part of the tpm_tools package.

Change-Id: I0728fb776a0c9cb90d885e7a1c76ff6a1a41a17b

Review URL: http://codereview.chromium.org/3195018
2010-08-30 11:43:57 -07:00
Randall Spangler
bb5d9f1286 Remove kernel backup space
BUG=chrome-os-partner:304
TEST=make && make runtests; all pass.  Manual testing on CRB.

Review URL: http://codereview.chromium.org/3132014
2010-08-16 15:36:07 -07:00
Randall Spangler
666802822b Change rollback interface so kernel/firmware version numbers are
packed in the calling code rather than in rollback_index.

Review URL: http://codereview.chromium.org/3114013
2010-08-16 12:33:44 -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
Randall Spangler
63dffcb52b Enable TPM in developer mode again.
Also fix a few comments, and make extra debugging work when compiled
in firmware.

BUG=none
TEST=make && make runtests; all pass

Review URL: http://codereview.chromium.org/3007036
2010-08-05 15:13:14 -07:00
Randall Spangler
ada3fa9ee6 Misc TPM cleanup
Review URL: http://codereview.chromium.org/3010019
2010-07-20 15:35:49 -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
Luigi Semenzato
8510d919f9 Replace TlclDefineSpace with SafeDefineSpace for extra paranoia.
Review URL: http://codereview.chromium.org/2937001
2010-07-08 15:40:30 -07:00
Randall Spangler
7a786b73e7 added reboot return codes to load kernel and firmware
Review URL: http://codereview.chromium.org/2844044
2010-07-08 13:29:42 -07:00
Luigi Semenzato
416f681882 This test sets the TPM to a each of a large amount of "interesting" initial states, and runs the firmware code at user level.
This code compiles and installs using a modified ebuild (which needs to be committed after this change).

Review URL: http://codereview.chromium.org/2857030
2010-07-08 12:12:12 -07:00
Luigi Semenzato
5e9c0b94b1 Never set bGlobalLock in recovery/dev mode. Don't try to fix bad kernel space.
Review URL: http://codereview.chromium.org/2804038
2010-07-02 10:36:37 -07:00
Luigi Semenzato
2b9ddae52b New rollback_index API.
Review URL: http://codereview.chromium.org/2869022
2010-06-28 13:34:31 -07:00
vbendeb
3ecaf776d8 Make vboot_reference build in MSVC command line environment.
This is a mostly NOOP change which modifies the source code
to compile cleanly in the MSVC command line build
environment.

A new makefile is introduced (msc/nmakefile) along with a
README.txt in the same directory explaining how to build
the code in the DOS window. As of this submission the build
is running in a 32 bit environment, the intention is to use
the same makefile for 64 bit builds in the future.

Enabling high compilation warnings level allowed to
identify a couple of bugs in the code which are being fixed.

Not all sources are being compiled in the MSVC environment,
only those in firmware/ and most of those in test/
subdirectories. The benchmark calculations require porting
of the timer facilities and are being postponed.

TEST

Built in DOS and linux environments. Ran unit tests in
linux environment.

Review URL: http://codereview.chromium.org/2809037
2010-06-24 16:19:53 -07:00
Randall Spangler
e2ec98412e Add VBDEBUG macro for debug output.
Replaced in firmware/ lib; not replaced in host-side utils/tests.

Review URL: http://codereview.chromium.org/2810026
2010-06-23 21:17:07 -07:00
Randall Spangler
1078838fff Refactor rollback interface for LoadKernel(), LoadFirmware().
Review URL: http://codereview.chromium.org/2861020
2010-06-23 15:35:31 -07:00
Luigi Semenzato
361049ce19 As mentioned, I discovered ForceClear doesn't really require any reboots. This change takes advantage of this fact.
Note that I am still using TPM_MUST_REBOOT because if power is lost between ForceClear and resetting the deactivated flag, the TPM will *really* be disabled at the next reboot, and it's nice to fix this problem automatically.

Review URL: http://codereview.chromium.org/2859016
2010-06-22 13:37:53 -07:00
Randall Spangler
beb5bae09f Fixes to compiler warnings in MSVC
Review URL: http://codereview.chromium.org/2851015
2010-06-21 16:33:26 -07:00
Randall Spangler
620c38cf34 Remove unused files, and tidy the directory structure of the remaining ones.
Review URL: http://codereview.chromium.org/2815011
2010-06-17 14:45:22 -07:00