Commit Graph

12 Commits

Author SHA1 Message Date
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
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
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
Bill Richardson
4052c3e3b8 random cleanup
Review URL: http://codereview.chromium.org/2353001
2010-05-27 18:16:09 -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
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
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
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
2480a18c45 Vboot Reference: Make kernel signing utility more flexible.
The CL adds the --config and --vblock option to kernel_utility.

--config <file> uses the file to populate the configuration portion within a signed vbootimage

Currently, the configuration file is assumed to only contain command line options to be passed to the kernel. In the future, we might want to change it so that it contains information about the kernel load address, entry points, etc. (refer to rspangler@ drive map design doc)

--vblock makes the tool only output the verification header instead of a one monolithic signed kernel image containing the verification information (with config information contained within it) followed by the actual kernel image

Review URL: http://codereview.chromium.org/1752013
2010-04-26 11:41:53 -07:00
Gaurav Shah
fc70d72aaa VBoot Reference: Refactoring Part 3
Refactor and restructure reference code into individual self-contain modules. I have revamped the way the code is structured to make it easy to determine which parts belong in the firmware and which are used by userland tools.

common/ - common utilities and stub functions (Firmware)
cryptolib/ - crypto library (Firmware)
misclibs/ - miscellaneous userland libraries (Userland)
sctips/ - Miscellaenous scripts (Userland)
tests/ - Tests (Userland)
vfirmware/ - Verified Firmware Implementation
vfirmware/firmware_image_fw.c (Firmware)
vfirmware/firmware_image.c (Userland)

vkernel/ - Verified Kernel Implementation
vkernel/kernel_image_fw.c (Firmware)
vkernel/kernel_image.c (Userland)

Review URL: http://codereview.chromium.org/1581005
2010-03-31 13:26:55 -07:00