Commit Graph

142 Commits

Author SHA1 Message Date
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
Bill Richardson
3c6f7a09a4 Better error messages, allow larger-than-needed input when reading.
Review URL: http://codereview.chromium.org/2351002
2010-05-28 09:27:10 -07:00
Randall Spangler
0ff6feaa79 Initial LoadKernel() implementation.
Review URL: http://codereview.chromium.org/2327002
2010-05-27 18:36:02 -07:00
Bill Richardson
4052c3e3b8 random cleanup
Review URL: http://codereview.chromium.org/2353001
2010-05-27 18:16:09 -07:00
Bill Richardson
82e0860e6d need to chmod binaries
Review URL: http://codereview.chromium.org/2325002
2010-05-27 18:03:32 -07:00
Randall Spangler
a9f17aa44a VerifyKernelHeader() fills a KernelImage*
Rather than copying individual fields.  More suitable for use in LoadKernel().

Added StatefulSkip(), so that fields in the input stream can be skipped more cleanly.

Review URL: http://codereview.chromium.org/2327001
2010-05-27 16:18:35 -07:00
Luigi Semenzato
ded1cecd36 Add missing TPM constant and fix test code.
Review URL: http://codereview.chromium.org/2320001
2010-05-27 15:19:58 -07:00
Bill Richardson
371df8bbbf Add install target to put utilities into chroot (in /opt/bin/)
Review URL: http://codereview.chromium.org/2225008
2010-05-27 14:19:47 -07:00
Luigi Semenzato
596b64052e New anti-rollback strategy (no TPM NVRAM write cycles for locking).
Review URL: http://codereview.chromium.org/2225005
2010-05-27 14:04:52 -07:00
Gaurav Shah
b85b06bb25 Add a --subkey switch to kernel signing utility.
This option makes the signing utility just output the kernel subkey (key signature) header which can be used to generate subsequent signed kernel images without needing the firmware root key and using the same kernel signing key. (This feature will be a part of a subsequent CL).

Review URL: http://codereview.chromium.org/2310002
2010-05-27 13:29:20 -07:00