Commit Graph

1223 Commits

Author SHA1 Message Date
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
Bill Richardson
d6ff721eb0 StatefulMem* functions should be library functions.
We want the BIOS to implement the stub functions, but that shouldn't include
our StatefulMem* functions.

Also, we ensure that we don't accidently use native linux functions instead
of the stub functions.

Review URL: http://codereview.chromium.org/2255006
2010-05-27 12:27:32 -07:00
Bill Richardson
f5db4b86fa Modifying the kernel_utility tool to create our magic blob.
For the --generate operation, the --in <file> option is gone and there are
three new required options:

  --vmlinuz <file>         Embedded kernel image
  --config <file>          Embedded kernel command-line parameters
  --bootloader <file>      Embedded bootloader stub

This takes the specified kernel, extracts the 32-bit component, and combines
that with the configuration file (essentially just the kernel cmdline
string) and the bootstub image . The resulting blob is signed and ready to
put in a kernel partition.

There's also an optional --padding parameter, to specify how much extra
(unsigned) space to leave between the signature header and the kernel blob.
The default is 0x4000, which is about four times as much needed when using
the largest signature size we currently support.

Review URL: http://codereview.chromium.org/2283005
2010-05-27 11:15:14 -07:00
Randall Spangler
3003c1dd50 Moved cgptlib into vboot_firmware
Moved cgptlib tests into tests

Review URL: http://codereview.chromium.org/2303003
2010-05-27 09:20:11 -07:00
Louis Yung-Chieh Lo
418ad3b620 complete 'cgpt show' and refactor for incoming commands.
Sorry for late. I spent some time to handle Guid endian issue and UTF16/UTF8 consversion. Also, refactored code for incoming commands.

Review URL: http://codereview.chromium.org/2231002
2010-05-27 11:21:17 +08:00
Gaurav Shah
bcd8f4a07c Make kernel signature a part of the kernel preamble.
With this change, the kernel signature is a part of the preamble block (and therefore, used during preamble signature verification).

BUG=670
TEST=image verification tests still pass. corrected splicing test expectations (and it passes).

Review URL: http://codereview.chromium.org/2292001
2010-05-26 13:19:00 -07:00
Gaurav Shah
5fe021b411 Rebaseline linktest with new/modified kernel verification API functions.
Review URL: http://codereview.chromium.org/2248003
2010-05-26 10:53:16 -07:00
Gaurav Shah
bf7615bc31 Change kernel vboot header layout and add support for separate header verification.
This CL adds 2 things:
- Instead of having a kernel config, now we have a kernel preamble which contains some important parameters needed by the bootloader in the firmware to kernel hand-off. These parameters are verified using a separate preamble signature in addition to the kernel signature on actual kernel image data.

- Adds a new VerifyKernelHeader() API function which verifies the kernel verified boot header excluding the kernel data and also extracts parameters out of this header needed to verify the actual kernel image data (if deemed necessary). This allows for vboot header verification and data verification to be performed separately.

Review URL: http://codereview.chromium.org/2234003
2010-05-26 10:26:00 -07:00
Bill Richardson
0b8f35c6a5 Rearrange vboot_reference directories to isolate external components.
This creates a new vboot_firmware subdirectory, and which contains the
entirety of the BIOS code. There shouldn't be anything in this directory
that is NOT required by the BIOS.

Review URL: http://codereview.chromium.org/2219004
2010-05-26 09:18:38 -07:00
Randall Spangler
a45586722f Expose GptData.current_kernel as an output of GptNextKernelEntry()
LoadKernel() needs to pass the kernel partition number out to the
BIOS, so it can be passed to the bootloader.

Review URL: http://codereview.chromium.org/2161007
2010-05-25 11:09:06 -07:00
Bill Richardson
93b09e5a4d Code cleanup.
Fix improper test of return value, replace order-dependent indices with
enumerated types in option parsing.

Review URL: http://codereview.chromium.org/2183001
2010-05-25 10:48:39 -07:00
Randall Spangler
590d10b109 Added struct members for bootloader offset/size.
Review URL: http://codereview.chromium.org/2163003
2010-05-24 16:04:11 -07:00
Randall Spangler
102bfba73a Load kernel APIs added (once more, from the correct repo)
Review URL: http://codereview.chromium.org/2165003
2010-05-24 15:14:33 -07:00
Louis Yung-Chieh Lo
8eaf239a04 support 'cgpt repair'
Review URL: http://codereview.chromium.org/2083020
2010-05-22 07:10:29 +08:00
Louis Yung-Chieh Lo
b31ddcec6a add cgpt framework and attribute support.
Review URL: http://codereview.chromium.org/2082015
2010-05-21 16:35:44 +08:00
Louis Yung-Chieh Lo
0dce41c2ec rename cgpt files with cgptlib prefix (to avoid conflicts to cgpt utility)
Review URL: http://codereview.chromium.org/2082007
2010-05-17 22:45:30 -07:00
Louis Yung-Chieh Lo
b17db3c4b9 cgpt supports GptNextKernelEntry() and GptUpdateKernelEntry()
Review URL: http://codereview.chromium.org/1922004
2010-05-05 11:21:08 -07:00
Louis Yung-Chieh Lo
49fa8e51ad Add more test cases for GptInit() and fixed some bugs
Review URL: http://codereview.chromium.org/1701017
2010-04-30 16:10:48 -07:00
Gaurav Shah
bd52fc793a VBoot Reference: Make kernel_config a 4K byte block, and move it after the verified boot block.
The kernel_config is now stored as a 4K binary block instead of the kconfig_options structure that was being used before. Since the verified boot code doesn't care what kernel config options are (other than the length of the kernel image and for verifying them before the rest of kernel), it is ok to keep them as a blackbox.

This CL also changes the verified boot kernel layout - VBlock Data followed by Kernel Config followed by the Kernel Image. This will allow them to be stored separately, or as a concatenated block (for easy memory mapping during kernel load). This should ease the process of generating a layout for verified boot kernel images which is also compatible with legacy BIOSes that don't support this mechanism.

Finally, there is also a new firmware API function to determine the size of a kernel verified boot block, given a pointer to its beginning (for determining the offset to the kernel config and data).

Review URL: http://codereview.chromium.org/1732022
2010-04-29 15:30:25 -07:00
Gaurav Shah
887e3d4700 Vboot Reference: Remove dependency on TrouSers by not including tss/tcs.h
Use "tss_constants.h" with TPM data type and constant definitions  instead.

Review URL: http://codereview.chromium.org/1712018
2010-04-27 16:26:48 -07:00