Commit Graph

360 Commits

Author SHA1 Message Date
Hung-Te Lin
a59a0293bd vboot_reference: add creation of GBB blob to gbb_utility
Non-x86 platforms (ex, ARM) may need to create GBB from scratch.
The new "create" (-c) creates a GBB blob by given property maximum sizes.
The list must follow same order as specified in GBB header.

BUG=chromium-os:1302
TEST=gbb_utility -c 0x100,0x1000,0x03DE80,0x1000 gbb.blob
     gbb_utility -s --hwid='test' gbb_blob
     gbb_utility -s --rootkey='some_rootkey' gbb_blob
     gbb_utility -g --hwid --rootkey='rk.bin' gbb_blob # output hwid=test

Change-Id: Ic854609effa32020f9536bc2d3f8457dff1c3719

Review URL: http://codereview.chromium.org/6173001
2011-01-10 13:37:17 +08:00
Che-Liang Chiou
b0310a7972 Add firmware image packing tool
BUG=chromium-os:1302
TEST=manual

(cros) $ cd vboot_reference/utility/
(cros) $ cat > test_config <<EOF
KEYDIR = '/usr/share/vboot/devkeys/'
OUTPUT = 'image.bin'
SIZE = 1 << 20 # 1 MB
ENTRIES = [
  EntryFmap(name='FMAP',
        offset=0x00000000, length=0x00001000,
        ver_major=1, ver_minor=0, base=0x00000000, size=SIZE),
  EntryKeyBlock(name='Firmware A Key',
        offset=0x00010000, length=0x00010000,
        flags=FMAP_AREA_STATIC,
        keyblock=KEYDIR + 'firmware.keyblock',
        signprivate=KEYDIR + 'firmware_data_key.vbprivk',
        version=1,
        fv=INPUT_FILE,
        kernelkey=KEYDIR + 'kernel_subkey.vbpubk'),
  EntryBlob(name='Test Data',
        offset=0x00020000, length=0x000e0000,
        flags=FMAP_AREA_STATIC | FMAP_AREA_COMPRESSED,
        path=INPUT_FILE),
]
EOF
(cros) $ ./pack_firmware_image test_config INPUT_FILE=./pack_firmware_image; echo $?
0
(cros) $ dump_fmap image.bin
opened image.bin
hit at 0x00000000
fmap_signature   __FMAP__
fmap_version:    1.0
fmap_base:       0x0
fmap_size:       0x00100000 (1048576)
fmap_name:       FMAP
fmap_nareas:     2
area:            1
area_offset:     0x00010000
area_size:       0x00010000 (65536)
area_name:       Firmware A Key
area:            2
area_offset:     0x00020000
area_size:       0x000e0000 (917504)
area_name:       Test Data

Review URL: http://codereview.chromium.org/5985009

Change-Id: I24aafc5788309adb1987035d87efac6262140c9c
2011-01-06 11:05:05 +08:00
Che-Liang Chiou
89678602e6 Fix integration bugs (vboot side)
BUG=chromium-os:8621
TEST=See below

1. Build and run tests of vboot (including linktest)
$ make && make runtests

2. Check if *_stub.o are not in vboot_fw.a
$ nm /build/<board>/usr/lib/vboot_fw.a | grep _stub.o

3. Build and boot x86-generic image
$ ./build_packages --board=x86-generic && ./build_image --board=x86-generic
(Then successfully boot the image you just built)

See CL=4372001 for u-boot side changes

Review URL: http://codereview.chromium.org/4266002

Change-Id: Icc2bcc551c998f370e4b737fbe442ebf029cd81c
2010-11-09 08:33:36 +08:00
Luigi Semenzato
900ce4b6f1 Use existing dash vs. underscore convention for scripts.
Change-Id: Iaad424a0bab6a1fc878576331c805025e80f3cb7

BUG=chromium-os:4870
TEST=tested

Review URL: http://codereview.chromium.org/4320001
2010-11-02 14:04:24 -07:00
Luigi Semenzato
35a6cb76ba Test the tpm recovery script with a real TPM.
Change-Id: I75bcf01d329220ff2c851035d3d9870410372e27

BUG=4870
TEST=included

Review URL: http://codereview.chromium.org/4087012
2010-11-02 10:37:16 -07:00
Bill Richardson
4f650a1fcd Add a few more commands to help debug verified boot.
BUG=chromium-os:8160
TEST=manual

Refer to http://code.google.com/p/chromium-os/issues/detail?id=8237 for
testing instructions.

To specifically test for this change, the log file should contain the string
(and output from running)

  "od -Ax -tx1 hd_kern_a.blob | head"

Change-Id: I910d1f0e41c03afd34bfa5139825e479d7124d71

Review URL: http://codereview.chromium.org/4242001
2010-11-01 15:28:12 -07:00
Gaurav Shah
551037b10e Make dumpRSAPublicKey also accept a public key in PEM format
This change makes dumpRSAPublicKey directly accept a public key in PEM format. This makes it possible to avoid the unnecessary step of generating a self-signed certificate to dump the public key in .keyb format.

The old style certificate input is still accepted.

Using certs (as done previously):
dumpRSAPublicKey -cert <certfile>

Directly using public keys:
dumpRSAPublicKey -pub <pubfile>

Change-Id: Ic35b59aff6613d145d7947212650da281f734b74

BUG=7576
TEST=manual

$ openssl genrsa -F4 -out test.pem 4096
$ openssl rsa -in test.pem -out test.pub
$ dumpRSAPublicKey -pub test.pub >test.pub.keyb

Verify that this matches the output we get using the old style <cert> input.

$ openssl req -batch -new -x509 -key test.pem -out test.cert
$ dumpRSAPublicKey -cert test.cert >test.cert.keyb
$ diff test.pub.keyb test.cert.keyb
$

Review URL: http://codereview.chromium.org/4215006
2010-11-01 13:33:32 -07:00
Bill Richardson
a98ad7aa24 Add option to dev_debug_vboot to clean up after running
Also provide a bit more output, stop and tell us if it's not running on a
Chrome OS BIOS.

Change-Id: I0e6a5680ec050b3f4d0a5c7adc87ca2441ba6d06

BUG=chromium-os:8236
TEST=manual

From a root shell, run "dev_debug_vboot --cleanup", then look in
/tmp/dev_debug/. You should see only the file noisy.log

Review URL: http://codereview.chromium.org/4108012
2010-10-29 11:12:36 -07:00
Gaurav Shah
068fc6f251 Add support for using external signing application and .pem private key files to vbutil_keyblock.
This allows signing using a .pem file using an external program.

It is assumed that the external program reads input from stdin, and outputs signed data on stdout. It takes one argument - the file name for the .pem private key reference. See external_rsa_signer.sh for an example external program.

Example usage:
vbutil_keyblock --pack 4096.keyblock \
                --datapubkey 4096.vbpubk \
                --signprivate_pem 4096.pem \
                --pem_algorithm 8 \
                --externalsigner "external_rsa_signer.sh"

I have tried to make the change such that it doesn't impact existing tools/interfaces (since these are used at various places). That said, I am aware of the places where we could just extend an old interface an avoid code duplication but thought I'd put that re-factoring in as a TODO for now. Let me know if you disagree and I can merge them (and changing the existing interface).

BUG=7576
TEST=Extended run_vbutil_tests.sh to test vbutil_keyblock packing using an external signer.

To test, make && make runtests (or just run tests/gen_test_keys.sh; tests/run_vbutils_tests.sh)

Review URL: http://codereview.chromium.org/4194003

Change-Id: I7cc52c8293c04ef9ba074794d046c9a4f19f6bdd
2010-10-29 10:59:50 -07:00
Luigi Semenzato
ba04b8b24c Add NVRAM size limit to nano-emulator and add test to recover from NVRAM hog attack.
Change-Id: I58265ddf26f2e93b9057fe6b95fb3c1b98e82e99

Add NVRAM-hogging DOS attack.

Change-Id: Ia178e42539a771747ab8a96560eb2d374ed07904

BUG=none
TEST=passes included test

Review URL: http://codereview.chromium.org/4183005
2010-10-28 10:31:47 -07:00
Luigi Semenzato
d903cc8333 Add resume command to tpmc.
Change-Id: Ie888a966d9914d0f3396c8fa5139fdddbdb76ff0

BUG=none
TEST=compiled and ran the program

Review URL: http://codereview.chromium.org/4185003
2010-10-27 09:42:51 -07:00
Will Drewry
9342f88e42 vbutil_kernel: support exporting a keyblock file during verify
Reuses the --keyblock argument to output a keyblock if used
during Verify().

TEST=built, ran on a kernel; check if it worked for cgpt find -M :)
BUG=chromium-os:7451

Change-Id: Ibf1365dbdaeaf87442e0d12d048bc070f35662ad

Review URL: http://codereview.chromium.org/4160001
2010-10-26 10:22:05 -05:00
Bill Richardson
6f9a99b538 Modify dev_debug_vboot for better usefulness
* Display only the synopsis on stdout
* Keep a verbose log of all activity in the scratch directory.
* Add more checks
* Providing a directory argument will use the images found there instead of
  trying to extract them from the system (for use on host machines).

Change-Id: I065a18c9467c625cc33484ee5556d955dc79b01d

BUG=none
TEST=manual

Get a root shell and run "dev_debug_vboot". You should see nicer output.

Review URL: http://codereview.chromium.org/4106001
2010-10-25 14:58:05 -07:00
Luigi Semenzato
3e3704f23d Script to diagnose and fix TPM problems in recovery mode.
Change-Id: I750bbc5c87bf824f0450986dd92be0cb8aea5555

BUG=
TEST=

Review URL: http://codereview.chromium.org/3838008
2010-10-25 12:36:03 -07:00
Bill Richardson
f356db46a6 Recommit a change that got accidently uncommitted.
Display keyblock information, even if not checking the signature.

Change-Id: Ie96ac39e2598fdfdc49898f92fd528edefd36313

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3602014

TBR=none
2010-10-25 11:39:16 -07:00
vbendeb
00b9088fb2 Consider zero a valid kernel version.
SAFT testing requires changing kernel version to one level
below the current value (set to 1). This change allows
version number set to zero for test purposes.

Change-Id: Ia6f11578d9a6bc8c5544c56413c5589011d6334a

BUG=chromium-os:1976
TEST=manual

Ran `vbutil_kernel --repack --version 0 <other params>'
it used to fail, now it succeeds. This is also verified by
using in http://codereview.chromium.org/3781016 to support
TPM testing.

Review URL: http://codereview.chromium.org/3968006
2010-10-21 13:46:16 -07:00
Bill Richardson
2f6a71fb34 Handle short read error correctly in vbutil_kernel.c
If you try to read a file that's all zeros, it tries to read a zero-length
kernel blob, fails to do so (or suceeds with an empty result, depending on
your point of view), and prints

  ERROR: Unable to read kernel blob from <file>: Success

That's not very helpful.

This change makes it say

  ERROR: No kernel blob found

instead.

Change-Id: I841ec6e288f47cd9b1f8e9ca1e6da0741ad20e9f

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3764004
2010-10-14 09:25:39 -07:00
Bill Richardson
c4e92af85a Address some security concerns in the cgpt tool.
1. Check for potential integer overflow in sector_bytes * sector_count.
2. Added O_NOFOLLOW to open() call - Is this enough?
3. Passing buffer length to GuidToStr(), PMBRToStr().
4. Use unsigned int in GetEntry() to determine stride.
5. Address conversion between UTF16 and UTF8.

Note: The UTF conversion is complex and troublesome, and needs careful
consideration to get right. For now, I've just forced the interpretation of
the partition name to 7-bit ASCII. That's sufficient for the needs of Chrome
OS, and I can file a new issue to handle UTF correctly.

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

Running "make runtests" invokes the tests/run_cgpt_tests.sh script, which checks the behavior and output of the cgpt tool.

Review URL: http://codereview.chromium.org/3594010

Change-Id: I5fd29796d8c929527e0cfbc6d5ccbcdc77502c6b
2010-10-12 07:33:15 -07:00
vbendeb
858fffb5ce Allow --repack option to change kernel version number.
RFro TPM rollback testing we need to be able to change kernel
version number. This Cl adds this ability to the
vbutil_kernel utility.

Change-Id: I156df9b0d3467043c20a43e1c75e6d0222704f3a

BUG=chromium-os:1976
TEST=manual

1. On a target running off /dev/sda3 (as reported by
'rootdev -s') execute `/usr/bin/dev_debug_vboot' and take
note of the kernel version number in the output section
starting with 'TEST: verify HD kernel A with firmware A key',
under 'Preamble' it should read
'Kernel version:      1'

2. copy the kernel into a file:
dd if=/dev/sda2 of=/tmp/kernel

3.on the desktop (this step requires ssh setup to use the
correct keys to reach the target):

scp tests/devkeys/kernel_data_key.vbprivk <target>:/tmp

3. Modify kernel version
vbutil_kernel --repack /tmp/repacked.k --version 2 --signprivate /tmp/kernel_data_key.vbprivk  --oldblob  /tmp/kernel

4. Install the updated kernel
dd if=/tmp/repacked.k of=/dev/sda2

5. restart the system

6. Observe that it came up using /dev/sda3 as the root
file system

7. run /usr/bin/dev_debug_vboot and observe that the kernel
version is no set to 2

Review URL: http://codereview.chromium.org/3520019
2010-10-06 09:51:44 -07:00
Bill Richardson
468cf3a20c Display keyblock information, even if not checking the signature.
Change-Id: Ie96ac39e2598fdfdc49898f92fd528edefd36313

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3602014
2010-10-05 10:47:30 -07:00
Luigi Semenzato
7c6a69f1cb Add a script that measures DAD behavior (Dictionary Attack Defense)
Change-Id: I303bb68c366c382caff20c1ee8dbfb97ed5e1c2d

BUG=none
TEST=ran the script

Review URL: http://codereview.chromium.org/3492011
2010-09-30 13:35:11 -07:00
Bill Richardson
cf0b05a9b7 Fix stupid wrong-stride bug.
Change-Id: Ic07d7409511adf1b30a9206cef0aa5d18a837897

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3405024
2010-09-24 07:47:47 +08:00
Luigi Semenzato
a8cba996b7 Utility to measure the available size of a TPM NVRAM.
Also change tpmc to return the TPM error code, or 255.

Change-Id: Ie5fc107ff50efd4480c2a47b91f3b8a93b4f95e3

BUG=none
TEST=ran it on a TPM

Review URL: http://codereview.chromium.org/3479003
2010-09-21 14:12:15 -07:00
Luigi Semenzato
a7e19cffbe Add new files: two tests, one common file, one program to set things up.
Change-Id: I4c9b7a937103f3978cbed6629ee4057018b80eae

More cleanup.  Also allow some tests to run even when TPM is already started.

Change-Id: I23558b96a1de55bbeca42dbf2e44f6802a0ec85b

Reorganize and standardize behavior of tests.

Change-Id: Id32fd09211a72deaa66a3dd0f973d35506ff96f2

BUG=433
TEST=ran all the tests I could run without TPM-free BIOS

Review URL: http://codereview.chromium.org/3389004
2010-09-15 17:20:36 -07:00
Bill Richardson
60bcbe3cd4 New tools to help debug vboot failures.
This adds some tools to help us figure out why a particular kernel isn't
booting. Often we suspect it's because it was signed with the wrong keys, or
has flags restricting its use to certain boot modes. This change adds some
tools to extract and display all the keys from the BIOS, and try them on the
various kernels. We also display the sha1sum of all the keys we find, to
make comparing them easier.

Change-Id: I38e447bf95cb6c3a0b87aa949611bb135f2f94b4

BUG=chromeos-partner:888
TEST=manual

To test, obtain a root shell, and run dev_debug_vboot. You should see lots
of useful information go by.

Review URL: http://codereview.chromium.org/3303018
2010-09-09 14:53:56 -07:00
Randall Spangler
1fe1607679 TBR: reviewed in person with semenzato 2010-09-02 11:37:51 -07:00
Bill Richardson
8adcb43774 Enhance output and helpfulness of --unpack options for vbutil_key
We now display the sha1sum of the public key contained in .vbpubk files,
and the --copyto option can be used to extract a minimal-sized .vbpubk or
.vbprivk from a file with extra padding on the end, to make comparisons
easier.

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3300006

Change-Id: Id465bf4f6f7d0545456a86968accc87964a769ef
2010-09-01 10:40:25 -07:00
Luigi Semenzato
89a02c194f Make TPM datagrams const, since they cannot be modified in the RO firmware.
Change-Id: I7f135584536c7437824ae65f74a8f7ef27c28665

BUG=
TEST=

Review URL: http://codereview.chromium.org/3271006
2010-08-31 15:49:56 -07:00
Luigi Semenzato
3da063e3f7 Add resume command (TPM_Startup(ST_STATE))
Change-Id: Ia85c3cdbcb74c6cd8e7bd53c51eaccc98b13677e

BUG=
TEST=

Review URL: http://codereview.chromium.org/3232006
2010-08-31 14:31:30 -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
Luigi Semenzato
1d83dd1ba5 Add a command to enable the physical presence command.
Change-Id: Id8b6ac3c75d1ee34237cde8adde55cea33b25889

Review URL: http://codereview.chromium.org/3163045
2010-08-30 10:23:43 -07:00
Luigi Semenzato
5896b9664d Added new commands and reactivated full rebuild after fixing for ARM ebuild.
Review URL: http://codereview.chromium.org/3116025

Change-Id: Ideb82562f6b1c3ce5cd9e0b79de250d0a7bd976e
2010-08-25 07:16:03 -07:00
Che-Liang Chiou
475bf447cc Add fake e820 memory map entries to zeropage
BUG=chromium-os:4521
TEST=manual

This patch set adds two e820 memory map entries to kernel's zeropage to
trick kernel into booting; otherwise kernel will choke on missing e820
memory map.

The added e820 memory map entries should let kernel boot and should not
make the memory map differ from that without the added entries.

Test Procedure:
1. Boot your test machine and save dmesg output, referred to as LOG1.
2. Apply the following one-line patch and then compile and install
   kernel.
3. Apply this patch set and re-build zeropage on kernel partition.
4. Boot the test machine and save dmesg output, referred to as LOG2.

LOG1 would contain the following messages (the exactly addresses of
memory map should differ slightly).
...
[    0.000000] BIOS-provided physical RAM map:
[    0.000000] bootconsole [earlyser0] enabled
...
[    0.000000] modified physical RAM map:
[    0.000000]  modified: 0000000000000000 - 0000000000002000 (usable)
[    0.000000]  modified: 0000000000002000 - 0000000000006000 (reserved)
[    0.000000]  modified: 0000000000006000 - 000000000008f000 (usable)
[    0.000000]  modified: 000000000008f000 - 0000000000090000 (ACPI NVS)
[    0.000000]  modified: 0000000000090000 - 00000000000a0000 (usable)
[    0.000000]  modified: 0000000000100000 - 0000000000f00000 (usable)
[    0.000000]  modified: 0000000001000000 - 000000003f33f000 (usable)
[    0.000000]  modified: 000000003f33f000 - 000000003f4bf000 (reserved)
[    0.000000]  modified: 000000003f4bf000 - 000000003f5bf000 (ACPI NVS)
[    0.000000]  modified: 000000003f5bf000 - 000000003f5f7000 (ACPI data)
[    0.000000]  modified: 000000003f5f7000 - 000000003f600000 (usable)
[    0.000000]  modified: 00000000fed1c000 - 00000000fed20000 (reserved)
[    0.000000]  modified: 00000000ffc00000 - 0000000100000000 (reserved)

LOG2 would contain the following messages (the exactly addresses of
memory map should differ slightly).
...
[    0.000000] BIOS-provided physical RAM map:
[    0.000000]  BIOS-e820: 0000000000000000 - 0000000000001000 (usable)
[    0.000000]  BIOS-e820: 00000000fffff000 - 0000000100000000 (reserved)
[    0.000000] bootconsole [earlyser0] enabled
...
[    0.000000] modified physical RAM map:
[    0.000000]  modified: 0000000000000000 - 0000000000002000 (usable)
[    0.000000]  modified: 0000000000002000 - 0000000000006000 (reserved)
[    0.000000]  modified: 0000000000006000 - 000000000008f000 (usable)
[    0.000000]  modified: 000000000008f000 - 0000000000090000 (ACPI NVS)
[    0.000000]  modified: 0000000000090000 - 00000000000a0000 (usable)
[    0.000000]  modified: 0000000000100000 - 0000000000f00000 (usable)
[    0.000000]  modified: 0000000001000000 - 000000003f33f000 (usable)
[    0.000000]  modified: 000000003f33f000 - 000000003f4bf000 (reserved)
[    0.000000]  modified: 000000003f4bf000 - 000000003f5bf000 (ACPI NVS)
[    0.000000]  modified: 000000003f5bf000 - 000000003f5f7000 (ACPI data)
[    0.000000]  modified: 000000003f5f7000 - 000000003f600000 (usable)
[    0.000000]  modified: 00000000fed1c000 - 00000000fed20000 (reserved)
[    0.000000]  modified: 00000000ffc00000 - 0000000100000000 (reserved)

Test result:
1. Compare the first paragraph of excerpts from LOG1 and LOG2:
   This shows that the fake e820 memory map entries are successfully
   added.
2. Compare the second paragraphs of excerpts from LOG1 and LOG2:
   This shows that the added entries do not modify the memory map.

diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c
index 49706d0..c9075ee 100644
--- a/arch/x86/kernel/e820.c
+++ b/arch/x86/kernel/e820.c
@@ -425,7 +425,7 @@ static int __init append_e820_map(struct e820entry
*biosmap, int nr_map)
 {
        /* Only one memory region (or negative)? Ignore it */
        if (nr_map < 2)
-               return no_e820_map_return();
+               return -1;

        return __append_e820_map(biosmap, nr_map);
 }

Review URL: http://codereview.chromium.org/3176019
2010-08-23 11:20:44 +08:00
Hung-Te Lin
07c81177ef touch source to test new ebuild system
Change-Id: I48b3e1d6b6f139d422e6eac80d9774b488192838

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3167030
2010-08-20 17:20:41 +08:00
Bill Richardson
4be36c4974 Oops. Pass the correct args to Verify* functions.
Change-Id: I08c7d702d97de0fecb8c0db8d63f479dd40f7723

Review URL: http://codereview.chromium.org/3155030
2010-08-19 08:27:31 -07:00
Bill Richardson
0697e3f0cf Enhance 'cgpt find' command to match keyblocks if desired.
This is part of the proposed developer-mode installation process, where we
want to detect that whoever is fiddling with the hard drive has already
fiddled with it before. Otherwise, we'll make them wait a bit to prevent
drive-by updates.

BUG=chromium-os:5306

Change-Id: Ifd6dce69180fa818fe14dbc3b1ac3485fb15d1c9

Review URL: http://codereview.chromium.org/3122023
2010-08-17 16:58:46 -07:00
Randall Spangler
138acfe1ba Fix KeyBlockVerify() to take an explicit param for whether to use hash only.
Fix VerifyMemberInside().

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

Review URL: http://codereview.chromium.org/3126013
2010-08-17 15:45:21 -07:00
Luigi Semenzato
c91e2390cb Add some commands to tpmc.
Review URL: http://codereview.chromium.org/3165023
2010-08-17 14:31:52 -07:00
Luigi Semenzato
d7bff87a74 Run self test unconditionally.
Review URL: http://codereview.chromium.org/3131007
2010-08-12 09:26:50 -07:00
Bill Richardson
83ba6d36b8 Clean up some style violations.
Addressing comments from http://codereview.chromium.org/3151005/show, which
has already been closed.

Change-Id: Ibe314831ac0d757b29f4bc0f0aae1a8f700e169c

Review URL: http://codereview.chromium.org/3108010
2010-08-11 13:23:35 -07:00
Luigi Semenzato
56cec581bb Add clear command.
Review URL: http://codereview.chromium.org/3167004
2010-08-10 15:09:37 -07:00
Bill Richardson
5aa673cacd Add dev_sign_file utility for developers to sign their install scripts.
BUG=chromium-os:5306

Review URL: http://codereview.chromium.org/3151005
2010-08-10 12:20:34 -07:00
Luigi Semenzato
e72291c636 Command-line utility to execute TPM commands bypassing the TSS stack.
Review URL: http://codereview.chromium.org/3149001
2010-08-10 09:46:09 -07:00
Bill Richardson
4f36ef3360 Changes to allow user-signed kernels to be generated.
Make vbutil_keyblock handle unsigned blocks. Also enable --unpack option and
add tests for it.

Modify vbutil_kernel to allow unsigned keyblocks, correct usage message,
and fix the --debug option which was somehow disabled.

Update load_kernel_test to accept /dev/null for the public key, to test
non-signed kernel keyblocks.

Review URL: http://codereview.chromium.org/3124004
2010-08-09 17:50:14 -07:00
Luigi Semenzato
f37fdf56fd Allow passing TPM device path in the environment.
Review URL: http://codereview.chromium.org/3032055
2010-08-04 17:13:08 -07:00
Luigi Semenzato
fda9488f97 Utility to run the self test before we can run tcsd.
Also test of the effects of the self test.

Review URL: http://codereview.chromium.org/3077016
2010-08-04 11:51:13 -07:00
Bill Richardson
5deb67f225 Make LoadKernel() pass back the kernel partition's UniqueGuid.
LoadKernel already returns the partition number for the selected kernel.
This change makes it also return the GPT Entry's UniqueGuid, which will
eventually be passed to the kernel itself, so the kernel can determine which
of several possible devices it has booted from. It doesn't know for certain
because the BIOS and the kernel may enumerate the devices in a different
order.

BUG=chromium-os:4984

Review URL: http://codereview.chromium.org/3056014
2010-07-23 17:22:25 -07:00
Bill Richardson
e272940ec5 Fix load_kernel_test, add check to LoadKernel to detect bad args.
load_kernel_test was failing because it wasn't setting
params->kernel_buffer_size before calling LoadKernel(). This fixes that,
plus adds some checks to LoadKernel so that it will notice bad params if it
happens again.

Review URL: http://codereview.chromium.org/3060004
2010-07-22 12:23:47 -07:00
Gaurav Shah
553d00ec86 (In the right repository this time.)
Do not directly manipulate global structs. Work on the local copy instead.

In firmware-land, globals are a bad idea.

Review URL: http://codereview.chromium.org/3027011
2010-07-19 19:22:10 -07:00
Randall Spangler
87c13d806b Added size param to VerifyData()
Also renamed verify preamble functions, now that they do not need the
'2' at the end to differentiate them from the now-deleted original
implementation.

BUG=4501
TEST=Ran make runtests; all pass.

Review URL: http://codereview.chromium.org/3027009
2010-07-19 10:35:40 -07:00