Commit Graph

151 Commits

Author SHA1 Message Date
Randall Spangler
a55e5ca76c Refactor LoadFirmware() to avoid global variables, which don't work when running out of ROM
Review URL: http://codereview.chromium.org/2848006
2010-06-15 18:45:09 -07:00
vbendeb
e3b4ac96bc Rough first draft of the firmware signing utility.
Based on utility/vbutil_kernel.c.

Should be merged with it eventually. Not really tested either, suggesting to submit it just to have a baseline for the verified boot chain.

Review URL: http://codereview.chromium.org/2792014
2010-06-15 15:01:20 -07:00
Randall Spangler
39ed88efe9 Implemented pipelined hash calculation in LoadFirmware()
Review URL: http://codereview.chromium.org/2802002
2010-06-15 14:53:01 -07:00
Randall Spangler
dcab8fab94 Add vbutil_firmware
Review URL: http://codereview.chromium.org/2837005
2010-06-15 14:50:51 -07:00
Luigi Semenzato
63ca39c4a9 Add ForceClear also on dev->normal transitions. Fix wrong API description.
Review URL: http://codereview.chromium.org/2807006
2010-06-15 13:33:01 -07:00
Axel Hansen
38476532ad Fixed VerifyFirmwarePreamble to check for a valid signing algorithm
Changed VerifyFirmwarePreamble to check for a valid kernel_subkey_sign_algorithm from the preamble.
Originally, an incorrect kernel_subkey_sign_algorithm wouldn't be detected and could cause the RSA
verification to read past the end of a buffer.

Review URL: http://codereview.chromium.org/2837002
Patch from Axel Hansen <axelrh@google.com>.
2010-06-15 10:53:18 -07:00
Luigi Semenzato
2666f10dec Fix normal/recovery mode, and RO firmware vs. RW firmware behavior.
Review URL: http://codereview.chromium.org/2792009
2010-06-15 08:12:32 -07:00
Randall Spangler
81d696f394 fix typos in load_kernel_test
Review URL: http://codereview.chromium.org/2820004
2010-06-14 17:23:32 -07:00
vbendeb
70e9509a27 Rework the vboot_reference make system.
After this change the generated files are placed in a
separate tree (such thet they don't show in the
`git status' output anymore) and the dependencies are
followed properly (if a .h file changes the
appropriate .o files and apps get rebuilt).

Tested as follows:

> $ make clean
> $ make # build succeeds
> $ git status # shows clean directory
> $ RUNTESTS=1 make # (captured test output matches that of the test run before any changes)
> $ touch ./vboot_firmware/include/tlcl.h
> $ make  # make succeeds
> $ find build -type f -newer ./vboot_firmware/include/tlcl.h
build/vboot_firmware/lib/rollback_index.o
build/vboot_firmware/lib/rollback_index.o.d
build/vboot_firmware/a.out
build/vboot_fw.a
build/utility/vbutil_key
build/utility/kernel_utility.d
build/utility/vbutil_key.d
build/utility/verify_data
build/utility/load_kernel_test.d
build/utility/vbutil_keyblock.d
build/utility/vbutil_kernel
build/utility/vbutil_kernel.d
build/utility/firmware_utility
build/utility/signature_digest_utility.d
build/utility/kernel_utility
build/utility/verify_data.d
build/utility/vbutil_keyblock
build/utility/signature_digest_utility
build/utility/load_kernel_test
build/utility/firmware_utility.d
build/tests/vboot_common3_tests
build/tests/vboot_common2_tests
build/host/a.out
$ >

Review URL: http://codereview.chromium.org/2845001
2010-06-14 15:41:27 -07:00
Randall Spangler
83c88cfa69 More cleanup
Review URL: http://codereview.chromium.org/2718012
2010-06-11 16:14:18 -07:00
Randall Spangler
729b87258b Clean up of key block functions
No substantial new code, just making the old code consistent.

Review URL: http://codereview.chromium.org/2729021
2010-06-11 11:16:20 -07:00
Randall Spangler
7d6898dbaa Added vbutil_kernel.
Review URL: http://codereview.chromium.org/2730011
2010-06-11 09:22:13 -07:00
Bill Richardson
f1372d9109 Nearly complete rewrite of cgpt tool.
This fixes a number of bugs, adds a bunch of commands, and essentially makes
cgpt ready to use as a replacement for gpt. Still to do is to add commands
and options that will let it generated intentionally bad partitions, for use
in testing.

Review URL: http://codereview.chromium.org/2719008
2010-06-11 09:15:55 -07:00
Randall Spangler
6a97b3e2a1 Add vbutil_keyblock
Review URL: http://codereview.chromium.org/2748008
2010-06-10 17:55:02 -07:00
Randall Spangler
d55c645372 Utility to pack public key, version, algorithm into a single file in VbPublicKey format
Review URL: http://codereview.chromium.org/2762009
2010-06-10 12:43:51 -07:00
Luigi Semenzato
4f11c36ebc Protect the kernel version space from redefinition.
Review URL: http://codereview.chromium.org/2786005
2010-06-10 11:01:04 -07:00
Randall Spangler
d183644564 Major refactoring of structures, with unit tests. This matches the doc I sent out earlier.
Firmware-side code for LoadKernel() is in place now.  LoadFirmware() replacement coming soon.

The new functions are implemented in parallel to the existing ones (i.e., everything that used to work still does).

Review URL: http://codereview.chromium.org/2745007
2010-06-10 09:59:04 -07:00
Luigi Semenzato
59204c57d0 Import recent tpm_lite changes that make all TPM commands return a status.
Review URL: http://codereview.chromium.org/2711006
2010-06-09 13:37:15 -07:00
Randall Spangler
4a7a9e3925 Uses TPM return codes.
Rollback_index funcs now all return 0 if succcess, nonzero if error.
(Note: not fully implemented; Luigi, please clean this up in a
subsequent CL)

LoadKernel() checks return codes from TPM funcs.

LoadKernel() only looks at versions from TPM in normal boot mode.

Review URL: http://codereview.chromium.org/2735004
2010-06-08 15:44:24 -07:00
Randall Spangler
57c08f6641 add load firmware stub
Review URL: http://codereview.chromium.org/2776002
2010-06-08 12:53:11 -07:00
Randall Spangler
7202eae824 Add dummy implementation of LoadFirmware(); currently a wrapper around the old implementation.
Review URL: http://codereview.chromium.org/2743004
2010-06-08 11:02:17 -07:00
Anush Elangovan
0e2a83e074 Update Watchlists
Change-Id: I2903aa4ba58bdc4be69defb4b9f99a94537d3432
2010-06-08 01:33:23 -07:00
Gaurav Shah
5173426100 Add option to specify a kernel subkey signing key to firmware signing utility.
If no kernel subkey signing key is specified, it reuses the firmware signing key.

Review URL: http://codereview.chromium.org/2696003
2010-06-08 00:16:35 -07:00
Randall Spangler
a319ac9c33 Added LoadFirmware() API
Supports passing back the kernel sign key blob, and updating the
firmware data hash during decompression.  Doesn't require data for
both firmware volumes before deciding which one to boot.

Intended to replace VerifyFirmwareDriver_f().

Review URL: http://codereview.chromium.org/2691006
2010-06-07 15:18:29 -07:00
Randall Spangler
c1a9f4d533 Added recovery-mode return code to LoadKernel()
This will be used if the TPM functions return error.

Review URL: http://codereview.chromium.org/2681003
2010-06-07 15:15:00 -07:00
Randall Spangler
e414b08c7b Move tlcl stub implementation to stub subdir.
Review URL: http://codereview.chromium.org/2668003
2010-06-04 14:21:59 -07:00
Luigi Semenzato
0a48681c4e Implement strategy for 64-write limit with unowned TPM.
Review URL: http://codereview.chromium.org/2655005
2010-06-04 13:34:43 -07:00
Bill Richardson
77d26e5190 Enable attributes to display and set properly.
Review URL: http://codereview.chromium.org/2614002
2010-06-04 12:26:42 -07:00
Randall Spangler
af5ae8e21b add inherit review settings for new repo
Review URL: http://codereview.chromium.org/2680001
2010-06-04 11:34:20 -07:00
Bill Richardson
31066a4515 Ignore the AlternateLBA field in the GPT headers.
We know where to look, and we'll look there regardless. We don't care where
the header creator thinks it should be.

Update tests to match.

Oh, and don't assume that I mean "/dev/FOO" if I just say "FOO". That's
really annoying.

Review URL: http://codereview.chromium.org/2606002
2010-06-03 15:20:19 -07:00
Hung-Te Lin
08dc5f381d Add 'recovery_key' in Google Binary Block (GBB) utility
Review URL: http://codereview.chromium.org/2553001
2010-06-03 14:35:47 -07:00
Bill Richardson
96ee63bbf3 Explicitly list dependency files instead of searching for them.
Review URL: http://codereview.chromium.org/2586003
2010-06-03 12:47:38 -07:00
Gaurav Shah
9592919196 Add a kernel subkey signing algorithm key and algorithm fields to firmware preamble.
Review URL: http://codereview.chromium.org/2589001
2010-06-03 11:11:33 -07:00
Randall Spangler
58efd70dc3 Turn off debug printf in LoadKernel()
Review URL: http://codereview.chromium.org/2559002
2010-06-03 10:53:48 -07:00
Randall Spangler
19d1313735 fixed VerifyKernelHeader
removed extra debugging
fixed printf() format specifiers

Review URL: http://codereview.chromium.org/2561001
2010-06-03 09:43:43 -07:00
Gaurav Shah
d4f13e3580 Remove obsolete VerifyKernelDriver() and associated data structures.
The kernel rollback test needs to be rebaselined to use the LoadKernel() (or may combined with load_kernel_test). Will do that as a separate CL when that is close to its final form.

Review URL: http://codereview.chromium.org/2584001
2010-06-03 07:50:50 -07:00
Gaurav Shah
e642198b93 Add a Makefile target to run all vboot_reference tests.
Review URL: http://codereview.chromium.org/2561003
2010-06-03 07:49:32 -07:00
Colin Chow
afdd058ebc fix int reference to unint64 from http://codereview.chromium.org/2438005
Review URL: http://codereview.chromium.org/2550001
2010-06-02 18:20:59 -07:00
Hung-Te Lin
21ef1a3678 Refine gbb_utility for better maintainance
* now -g (get mode) becomes default
 * properties are now managed in a more generalized way so adding new property would be more easy

Review URL: http://codereview.chromium.org/2549001
2010-06-02 18:13:47 -07:00
Randall Spangler
b8976b6d44 Remove load_kernel from build
Review URL: http://codereview.chromium.org/2535001
2010-06-02 16:38:33 -07:00
Randall Spangler
40226c05ab Put gpt.h back
Review URL: http://codereview.chromium.org/2504001
2010-06-02 15:01:03 -07:00
Randall Spangler
3dcf9dce04 Much rearranging of cgptlib. Passes all its (new) unit tests.
Also includes part of LoadKernel(), which I'll split into a separate
CL.  With some hacks, gets into VerifyKernel() before dying because
I'm not passing in the right key blob.

cgptlib is now pretty stable, and worth looking at.  LoadKernel() less so.

Thanks,
   Randall

Review URL: http://codereview.chromium.org/2438005
2010-06-02 12:46:17 -07:00
Bill Richardson
5374a06114 Add cgpt utility to installable binaries.
Review URL: http://codereview.chromium.org/2490001
2010-06-02 08:23:30 -07:00
Louis Yung-Chieh Lo
e6cf857685 cgpt supports dev and add/delete/modify commands.
Review URL: http://codereview.chromium.org/2374001
2010-05-29 18:54:25 +08:00
Gaurav Shah
67660cda7a Add --subkey_in and --subkey_out options to firmware signing utility.
With this change, just like the kernel signing utility, the firmware signing utility now supports outputting the key signature (subkey) header and reusing it to generate new signed firmware images without requiring the root key (assuming the firmware signing key doesn't change).

Also, some minor comment fixes I missed the last time around.

Review URL: http://codereview.chromium.org/2366004
2010-05-29 01:58:07 -07:00
Gaurav Shah
6bcaa107fb Change to the new prototype/name for Get/WriteStoredVersions().
This should fix the compilation error after Luigi's latest change went in.

Review URL: http://codereview.chromium.org/2358002
2010-05-28 12:31:11 -07:00
Gaurav Shah
f666780e86 Add --subkey_in option to kernel signing utility.
This allows for using an existing key signature (subkey) header to generate new signed images if the kernel signing is unchanged. This obviates the need to take out the firmware private key each time a new signed kernel image is generated.

A similar change will also be propagated to the firmware signing utility. We would REALLY like to reduce the need to take out the verified boot private root key (used for generating R/W firmware key signature headers) everytime we generate a new signed R/W firmware image.

Review URL: http://codereview.chromium.org/2372001
2010-05-28 11:47:33 -07:00
Gaurav Shah
2a9c66cd71 Cleanup option parsing for firmware signing utility.
This is basically the same as Bill's changes for kernel_utility.

Review URL: http://codereview.chromium.org/2322003
2010-05-28 11:42:48 -07:00
Luigi Semenzato
52a8d2df06 Add recovery mode protection to new NVRAM locking scheme.
Also fix the TPM initialization.

Review URL: http://codereview.chromium.org/2344002
2010-05-28 10:34:31 -07:00
Hung-Te Lin
262668fcf3 Added gbb_utility (tool for Google Binary Block)
Review URL: http://codereview.chromium.org/2346001
2010-05-28 10:32:02 -07:00