Commit Graph

507 Commits

Author SHA1 Message Date
Randall Spangler
cce4171545 Add more tests for rsa.c.
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: Ib1cdb139b695a648fc500ad61c58efc86c7940a9
(cherry picked from commit 5178f3ce82020e8caa287ceee47f9556c0b3bae8)
Reviewed-on: http://gerrit.chromium.org/gerrit/6860
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-29 15:20:11 -07:00
Randall Spangler
a8c7fab879 Fix makefile typo
BUG=none
TEST=emerge-tegra2_aebl vboot_reference

Change-Id: Idc792a1e8b9636a3959fecfde85110e560a64895
Reviewed-on: http://gerrit.chromium.org/gerrit/6836
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-29 13:11:16 -07:00
Randall Spangler
46d37cfbbb Remaining unit tests for rollback_index.c
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: If2fbfb788bc3199603c8646e8f1c9e061199bc6f
Reviewed-on: http://gerrit.chromium.org/gerrit/6832
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-29 12:58:38 -07:00
Randall Spangler
cb3313e8cb Partial unit tests for rollback_index
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: I8ea6bcc15f277e10c5b8539f2ea19ad90be34889
Reviewed-on: http://gerrit.chromium.org/gerrit/6770
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-26 14:15:26 -07:00
Randall Spangler
aeb8632258 Add unit tests for tpm_bootmode
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: I6437e41f55d5b705a3768d325999847c5753a13d
Reviewed-on: http://gerrit.chromium.org/gerrit/6627
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-25 09:04:35 -07:00
Randall Spangler
68f6049f3f Add missing tests for vboot_common
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: I8dd6103eb60c8bc5af2abdd733d8f581984f27b9
Reviewed-on: http://gerrit.chromium.org/gerrit/6615
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-24 15:47:58 -07:00
Randall Spangler
f02bbb4635 Add tests for utility.h and sysincludes.h macros
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: Id0a834c2b234d5f9cbbb37a69426e2b97c734d0a
Reviewed-on: http://gerrit.chromium.org/gerrit/6608
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-24 14:38:02 -07:00
Randall Spangler
1f5d53f7bd Add tests for vboot_reference stateful_util.c
BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: I5d55be2dfead0c5d7af72841cbd6c65485685cd6
Reviewed-on: http://gerrit.chromium.org/gerrit/6596
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-24 13:50:51 -07:00
Randall Spangler
a3454fcaa4 Add unit tests for utility.c
Also fixes returned value from Memset().  And SafeMemcmp() should
return 0 (equal) if comparing 0 bytes, to match the behavior of memcmp().

BUG=chromium-os:17564
TEST=make && make runtests

Change-Id: Id43e70eecf04815216e1fd952271af35e0a66396
Reviewed-on: http://gerrit.chromium.org/gerrit/6539
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-23 15:30:59 -07:00
Randall Spangler
a2da72b4b0 Disable broken bmpblock_utility test
The current bmpblock_utility doesn't preserve the order of images as
specified in the config yaml file.  This doesn't affect the
functioning of the firmware, but does break this overly-restrictive
test.

Filed crosbug.com/19541 to fix this after Bill's current refactoring.

BUG=chromium-os:19541
TEST=make && make runtests

Change-Id: I03fe817bd191fec5f65aad37561a3224b6a2b1e6
Reviewed-on: http://gerrit.chromium.org/gerrit/6512
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-08-23 13:58:00 -07:00
Randall Spangler
a712e01ae7 Add support for flags in the firmware preamble.
The old (v2.0) parser is compatible with new (v2.1) structs.  That is,
this won't break existing firmware or vbutil_firmware.

A new (v2.1) parser parsing an old (v2.0) struct will return 0 for the
flags.

This will be used to support the RO-normal code path in a subsequent CL.

BUG=chromium-os:17304
TEST=added unit tests; make && make runtests

Change-Id: I73bcd8acd3330b0d7d143061b5ef838e6d79cf1a
Reviewed-on: http://gerrit.chromium.org/gerrit/4030
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-13 10:13:12 -07:00
Randall Spangler
daa807c51e Add support for dev_boot_usb flag
BUG=chromium-os:17433
TEST=make && make runtests.  Additional manual tests:

0. Insert a valid dev-signed USB key.

1. Boot with dev switch off.
`crossystem dev_boot_usb` should print 0.

2. Flip dev switch on.
`crossystem dev_boot_usb` should print 0.
Ctrl+U at dev screen should beep, but not boot USB.

3. Type `crossystem dev_boot_usb=1`.  Should succeed.
`crossystem dev_boot_usb` should print 1.

4. Reboot system.
At the dev mode warning, press Ctrl+U
System should boot from USB key
`crossystem dev_boot_usb` should print 0.

5. Flip dev switch off.
`crossystem dev_boot_usb` should print 0.

6. Flip dev switch on.
`crossystem dev_boot_usb` should print 0.

Note that this does not apply to Cr-48, Alex, or ZGB.

Change-Id: Idf85fdd642f38f531c89e5fa5b1679e84936d4da
Reviewed-on: http://gerrit.chromium.org/gerrit/3875
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Stefan Reinauer <reinauer@google.com>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-11 18:16:03 -07:00
Randall Spangler
4ae77c50cd Fix compiler warning in vboot_reference
BUG=none
TEST=none

Change-Id: I60089b4bfb5f4ba2f0df66f335794b3fed1495f3
Reviewed-on: http://gerrit.chromium.org/gerrit/3787
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-08 09:33:35 -07:00
Randall Spangler
bebe53c919 Add string utility functions.
These are used by the coming-soon vboot wrapper (vboot_api_kernel) to
display debug information when Tab is pressed at a BIOS screen.

BUG=chromium-os:17035
TEST=make && make runtests (runs new test!)

Change-Id: I4893f31e9333f4e9d458a6e347213eef22f770cd
Reviewed-on: http://gerrit.chromium.org/gerrit/3759
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-07-08 09:17:07 -07:00
Randall Spangler
1c1a883bc7 Fix ARM build for vboot_reference crossystem lib
BUG=none
TEST=none

Change-Id: I655cd69a0e1d2a3ad6ce9f326cbd989fc8ecb43d
Reviewed-on: http://gerrit.chromium.org/gerrit/3270
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 15:51:38 -07:00
Randall Spangler
32a6526d25 Verified boot wrapper - add stub implementations for host
This is part 2 of the wrapper API refactor.  It adds stub
implementations for the host, and changes the host-side utilities to
use them.  Firmware implementation is unchanged in this CL (other than
a few updates to macros).

BUG=chromium_os:16997
TEST=make && make runtests

Change-Id: I63989bd11de1f2239ddae256beaccd31bfb5acef
Reviewed-on: http://gerrit.chromium.org/gerrit/3256
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
2011-06-27 13:30:41 -07:00
Bill Richardson
4395b699c1 Address compiler warnings (errors) for gcc-4.6
BUG=chromium-os:15043
TEST=manual

Change-Id: If6499d9453fd6f754d04076d0e2b6fd25fc636e5
Reviewed-on: http://gerrit.chromium.org/gerrit/562
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
2011-05-09 15:57:09 -07:00
Luigi Semenzato
f3822e4d0c Fix missing break in switch statement.
Change-Id: I9a2a29f958e5760dabdaa0f2a2d6ca29029f9f94

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/6893071
2011-04-28 15:00:38 -07:00
Randall Spangler
cabe6b3514 Use VbSharedData instead of VbNvStorage for fwb_tries and kernkey_vfy
Change-Id: I5ed3509a9d4e578cd2e98f493dab59bc2fbd5827

R=dlaurie@chromium.org
BUG=chrome-os-partner:2748
TEST=manual

crossystem fwb_tries=3
(reboot)
crossystem tried_fwb
(should print 1)

crossystem fwb_tries=0
(reboot)
crossystem tried_fwb
(should print 0)

In dev mode...
Boot a kernel signed with the same key as in the firmware
crossystem kernkey_vfy
(should print sig)
Boot a kernel signed with a different key than the firmware
crossystem kernkey_vfy
(should print hash)

Review URL: http://codereview.chromium.org/6711045
2011-03-18 12:44:27 -07:00
Luigi Semenzato
0d2d139204 Run TPM timing test to completion instead of stopping at the first error.
Change-Id: Iae764bfeb2c766abb550f338db3d35d1d7eebf1d

BUG=433
TEST=compiled and ran.  (QA NOTE: no testing required)

Review URL: http://codereview.chromium.org/6462013
2011-03-15 15:49:49 -07:00
Randall Spangler
b17e8d353c Add VB test error func/num
Change-Id: Ibe253963f0424935554fe91f166ef5040a723c6f

BUG=13107
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6698032
2011-03-15 09:50:38 -07:00
Gaurav Shah
5746845500 Add support for using separate developer firmware keyblock while signing.
Also re-factor the key generation script to its own directory, including wrappers for generating key pairs and keyblocks without needing to start keyset generation process from scratch. (Useful for generating new kernel keyblocks, and for retroactively adding new keys to an existing keyset - as in this case).

Finally, change hard coded algorithm ids and keyblock modes to bash variables, for each changes and telling keyset configuration from a glance.

BUG=chrome-os-partner:2218
TEST=manually tried the following:
1) Generating an entire new keyset.
2) Generating a new key pair and creating a keyblock from an existing key (for generating dev firmware keyblock for existing PVT keysets)
3) Firmware signing via sign_official_build.sh of an image with a firmware payload/

Change-Id: I4e9bb96ac7e5fe4cc0d95af6162ad6d37bbd4bda

Review URL: http://codereview.chromium.org/6594131
2011-03-02 14:50:46 -08:00
Randall Spangler
92e378e453 rename tried_fwb constants
Change-Id: Ib8018bfe29eed50766c699d832efe4f1afcabb1a

BUG=none
TEST=make && make runtests

Review URL: http://codereview.chromium.org/6597015
2011-02-25 13:56:53 -08:00
Randall Spangler
172602829d Add NV storage fields for firmware flags
1) Did firmware attempt RW slot B before slot A?

2) Did firmware check the kernel keyblock signature, or just its hash?

Added crossystem support as well.

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

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

Change-Id: I0d743ae87cedd938ba988170793717d3fdbd8ce9
2011-02-25 12:06:26 -08:00
Randall Spangler
efa40aa21d Add dev firmware key to devkeys.
The existing keys are kept the same, so that old dev kernels and
firmware remain compatible with new kernels and firmware.

Change-Id: I4177d1868904a477d79b9f2e6de88ed756ed57b4

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

Build firmware with new keys.

Boot with dev switch on.
Run 'crossystem mainfw_act mainfw_type'.
Should see "A developer"

Boot with dev switch off.
Run 'crossystem mainfw_act mainfw_type'.
Should see "B normal"

Review URL: http://codereview.chromium.org/6580035
2011-02-24 11:05:34 -08:00
Randall Spangler
9e162cdaa7 VbNvStorage cleanup and comments
BUG=12282
TEST=make && make runtests

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

Change-Id: I912b53ae33d65305353a747cc0bdd2b1ea62a04f
2011-02-22 13:06:53 -08:00
Randall Spangler
b944534edd Add NV storage API to vboot reference
BUG=chromium-os:12282
TEST=make && make runtests

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

Change-Id: I57099de54ed56aa722f1944568bbb58b71b14379
2011-02-17 15:57:39 -08:00
Bill Richardson
a7209ee2de Allow yaml file to specify default compression for images
BUG=chromium-os:11490
TEST=manual

  cd src/platform/vboot_reference
  make
  make runbmptests

Change-Id: Ia887fc1aa1de873c6da6c04995bc0a9ad6b364aa

Review URL: http://codereview.chromium.org/6541001
2011-02-17 14:30:14 -08:00
Bill Richardson
f456e83dfd Correctly handle reuse of screens in yaml file.
BUG=chromium-os:12161
TEST=manual

  cd src/platform/vboot_reference
  make
  make runbmptests

Change-Id: Ic7708474ce7009744c9f12154d1967bdae8e55d2

Review URL: http://codereview.chromium.org/6534025
2011-02-17 11:29:51 -08:00
Bill Richardson
f82f941b80 Write images to the bmpblock in the order they appear in the yaml.
This ensures that equivalent yaml files produce identical bmpblock binaries.

BUG=chromium-os:12158
TEST=manual

  cd src/platform/vboot_reference
  make
  make runbmptests

Change-Id: Ic8103ff90e57034d72fb3920a6c198c77768f162

Review URL: http://codereview.chromium.org/6533012
2011-02-17 08:56:33 -08:00
Tom Wai-Hong Tam
ee2bc91d43 Enable LZMA compression in bmpbklk_utility.
LZMA has better compression ratio and is also supported in u-boot already.
ARM BIOS will use LZMA to compress BMP files.

BUG=chromium-os:11017
TEST=manual
$ make
$ make runbmptests

Change-Id: I6b791e3284b65eb3085b0de548bd241eab2ee598

Review URL: http://codereview.chromium.org/6523019
2011-02-17 12:58:58 +08:00
Bill Richardson
61362d65fc Enable EFIv1 compression in bmpbklk_utility.
This lets bmpbklk_utility generate BMPBLOCKs with EFIv1-compressed bitmaps.
It also adds the ability to display or unpack BMPBLOCK blobs.

The compression/decompression routines come from the tianocore EDK on
sourceforge and are written in C, so now there's a mix of C and C++, but it
works just fine.

BUG=chromium-os:11491
TEST=manual

cd src/platform/vboot_reference
make
make runbmptests

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

Change-Id: Ie05e1a3fd42f4694447c8c440b2432af4ac0f601
2011-02-14 10:28:03 -08:00
Bill Richardson
794d4d44db New commandline args are clearer, and prepare for compression.
BUG=chromium-os:11488
TEST=none

Change-Id: I6ee493037da5746d2db6e840ac6590dd12f37cfe

Review URL: http://codereview.chromium.org/6482001
2011-02-10 19:13:10 -08:00
Bill Richardson
fc05bb854f Test BMP files more thoroughly to be sure they're valid.
This is work-in-progress. More tests to come...

Change-Id: Id2e59fd7d0229be3ad90b29b2d0dc035ceeca666

BUG=chromium-os:11766
TEST=manual

Adding an example to the test framework. Use

  make
  make runbmptests

to ensure it works.

Review URL: http://codereview.chromium.org/6286157
2011-02-08 15:03:36 -08:00
Luigi Semenzato
8e14bc05e8 Improve error messages from tests.
Change-Id: I111e0fb38188e70659d735f0949a7bdb548a258b

BUG=433
TEST=compiled and ran the tests.  No QA testing required.

Review URL: http://codereview.chromium.org/6349091
2011-02-08 14:50:41 -08:00
Bill Richardson
856e072e81 Add test framework for bmpblk_utility.
BUG=chromium-os:11742
TEST=manual

Check out sources, run:

  cd src/platform/vboot_reference
  make
  make runbmptests

It should pass.

Change-Id: I50ebdef26662e7446828315a3f5e2786624508b9

Review URL: http://codereview.chromium.org/6246150
2011-02-07 15:39:45 -08:00
Bill Richardson
3430b32667 Add 'prioritize' command to cgpt tool.
This lets us reorder the priority of all the kernel partitions with a single
command, instead of a bunch of complicated and error-prone shell script
logic.

Change-Id: I21d39763ec5a748488d5319a987bcfe7c34ce4d0

BUG=chromium-os:9167
TEST=manual

In the chroot, do this:

cd ~/trunk/src/platform/vboot_reference
make
make runtests
make clean

Everything should pass.

Review URL: http://codereview.chromium.org/5352005
2010-11-29 14:24:51 -08:00
vbendeb
38e9a08de0 Include gen_fuzz_test_cases when execting tests.
Change-Id: I2e325ff9bd53fdaeb69c2d115c30785d6ca09b57

BUG=chromium-os:7178
TEST=manual:

Both in host and chroot environments:

. run `make clean && make && make runtests' in the top
  directory
. observe the following being added in the end of the
  report:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
./gen_fuzz_test_cases.sh
Generating test image file...
1+0 records in
1+0 records out
500000 bytes (500 kB) copied, 0.0790024 s, 6.3 MB/s
Generating test bootloader file...
1+0 records in
1+0 records out
50000 bytes (50 kB) copied, 0.00921653 s, 5.4 MB/s
Generating test config file...
1+0 records in
1+0 records out
3000 bytes (3.0 kB) copied, 0.000618682 s, 4.8 MB/s
Generating key blocks...
Generating signed firmware test image...
Generating signed kernel test image...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Review URL: http://codereview.chromium.org/4687007
2010-11-10 17:12:43 -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
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
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
Gaurav Shah
3dd3ce8560 Make the factory installer keyblock use a different kernel key than the recovery key.
BUG=chromium-os:7202
TEST=none

Change-Id: I9dd798ab9fc4cfd660c4f5dd4d970180c917dd9d

Review URL: http://codereview.chromium.org/3824005
2010-10-17 13:18:43 -07:00
Hung-Te Lin
20525b9164 make_dev_ssd: new script to change SSD image to dev key
The make_dev_ssd.sh is made for devinstall shim to
change SSD kernels to be signed by dev keys.

 - Kernel A, B will be resigned with dev keys (ignore if A/B seems not bootable)
 - Adding param --remove_rootfs_verification can even disable rootfs hash check

This CL also includes some shared refine/fix to make_dev_firmware.sh

BUG=chrome-os-partner:1276
TEST=sudo ./make_dev_ssd.sh; (seeing Kernel A is resigned and B is ignored)
     then reboot without developer mode (OK),
          rootdev shows /dev/dm-0, rootdev -s shows /dev/sda3
     sudo ./make_dev_ssd.sh --remove_rootfs_verification;
     then reboot without developer mode (OK), rootdev shows /dev/sda3

Change-Id: Ic20f734b2af42e50a43c19a565a166a39d57a7fd

Review URL: http://codereview.chromium.org/3772013
2010-10-16 09:37:32 +08:00
Luigi Semenzato
d7eff3e8aa Always compile the TPM tests with -DVBOOT_DEBUG.
Change-Id: I63fcb58b8415dd08417585f53bde655ca83e1f48

BUG=none
TEST=compiled locally and emerged for x86-generic

Review URL: http://codereview.chromium.org/3535006
2010-10-04 18:05:54 -07:00
Luigi Semenzato
e523695263 Fix build broken by assert() expanding to nothing.
Change-Id: I4d781bad6e638d681e930b70ed94fa3ec694ab0a

BUG=none
TEST=compiled locally and with emerge-x86-generic.

Review URL: http://codereview.chromium.org/3551014
2010-10-04 13:20:00 -07:00
Luigi Semenzato
9565edc4c9 Revive TPM firmware autotest.
Change-Id: I2e798ac8898852aa44a8979e67dfa4de385a6e34

BUG=none
TEST=ran the autotest on a CRB with special firmware

Review URL: http://codereview.chromium.org/3389029
2010-09-30 13:44:00 -07:00
vbendeb
a222fbc00e Fix test suite deficiencies.
While trying to debug/test some vbutil_kernel changes
(coming in a different CL) it was noticed that this utility
is not covered by tests, and the script which runs it to set
up further testing (tests/gen_fuzz_test_cases.sh) fails
because of the key format mismatch.

Some investigation has shown that this was left behind when
vboot_reference key storage format was changed.

To make gen_fuzz_test_cases.sh work again a new set of test
keys is required, the keys are generated by
tests/gen_test_keys.sh. This utility had to be changed to
generate the proper set of wrapped public and private keys.

Actually code in tests/gen_test_keys.shgenerate_keys() is
copied in pasted in many scripts in this tree, this has to
be refactored, but under a different CL.

Once the changes were made, two scripts were run:
 ./tests/gen_test_keys.sh
 ./gen_test_cases.sh

resulting in the new and updated keys generated.

firmware/stub/tpm_lite_stub.c was edited to fix compilation
warning issued when compiling with debugging enabled.

Change-Id: I26a45cbad00d21a29195f2a89b4df7d3559133fe

BUG=chromium-os:7178
TEST=described below

The following commands succeed:

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
make
make runtests
./tests/gen_fuzz_test_cases.sh
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

note that  ./tests/gen_fuzz_test_cases.sh was failing
before this change.

The upcoming CL modifying vbutil_kernel will make sure
gen_fuzz_test_cases.sh is executed when tests are run and
will enhance it to cover vbutil_kernel testing.

Review URL: http://codereview.chromium.org/3423022
2010-09-29 20:25:29 -07:00
Luigi Semenzato
ef176b7599 Add missing header file.
Change-Id: I2b0fdab305fc3b7286679ac133daed62523fb241

BUG=none
TEST=none

Review URL: http://codereview.chromium.org/3423009
2010-09-15 18:12:35 -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
Gaurav Shah
8b7baafee1 Fix autotest Makefile for vboot_reference.
Update list of scripts and test binaries - slightly more involved since the test runner scripts and the test binaries themselves reside in different directories.

BUG=none
TEST=manual (Ran make, went into the tests/ directory and ran the tests)

Change-Id: I97bd36d806726f6005e35490173cfcd0300add95

Review URL: http://codereview.chromium.org/3326014
2010-09-07 18:19:21 -07:00