Commit Graph

15 Commits

Author SHA1 Message Date
Randall Spangler
7c3ae42e04 vboot: Convert vboot1 SHA calls to use vboot2
This change replaces all calls to the old vboot1 SHA library with their
vboot2 equivalents.

This is the first in a long series of changes to move the core vboot kernel
verification into vb2, and the control/display loop out to depthcharge.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; build samus firmware and boot it

Change-Id: I31986eb766176c0e39a192c5ce15730471c3cf94
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/344342
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2016-07-22 18:40:04 -07:00
Bill Richardson
35c69cc159 futility: put the recognizer functions in file_type.inc
This is preparation for a refactoring of how files are traversed.
file_type.inc will specify functions to recognize, show, or sign
each type of file.

This change puts the recognizer functions in file_type.inc, but
just stubs out the show and sign commands.

BUG=chromium:231574
BRANCH=none
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I1596a21319a8fb1182537abdf9be0196bef4b84b
Reviewed-on: https://chromium-review.googlesource.com/262893
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-03-31 06:28:05 +00:00
Bill Richardson
45ecc3d447 futility: send debug messages to stdout, not stderr
It's more useful to see the debug messages interleaved with the
regular output instead of going to a separate stream.

BUG=none
BRANCH=none
TEST=make runtests

Try:

  futility --debug show tests/futility/data/bios_zgb_mp.bin | less

Change-Id: I43526821fc93b2af4d6d01b3bc2465e5b9672e26
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/262717
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-03-27 01:34:30 +00:00
Bill Richardson
c8054eae60 Provert "futility: Make --debug a global option"
This reverts commit d90b07bd4d,
which reverted d7e1e4f0be, which
didn't actually have anything wrong with it.

BUG=chromium:466433
BRANCH=one
TEST=None

Change-Id: I68a60c38eba1fce1c9332601a57ea8fee72139a3
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/259650
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Prathmesh Prabhu <pprabhu@chromium.org>
2015-03-12 19:27:19 +00:00
Prathmesh Prabhu
d90b07bd4d Revert "futility: Make --debug a global option"
This reverts commit d7e1e4f0be.

BUG=chromium:466433
TEST=None.

Change-Id: Ia1b300e2dbccddbbae9e831709bc49eb53a5feb8
Reviewed-on: https://chromium-review.googlesource.com/259365
Reviewed-by: David James <davidjames@chromium.org>
Tested-by: Prathmesh Prabhu <pprabhu@chromium.org>
2015-03-12 03:16:00 +00:00
Bill Richardson
d7e1e4f0be futility: Make --debug a global option
Some commands look for a --debug option, others don't. The
feature is implemented globally, so let's parse it as a global
option.

BUG=none
BRANCH=none
TEST=make runtests

Change-Id: I3b169e4a1b93443786913276651113d1c915a834
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/258500
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-03-11 07:50:27 +00:00
David Riley
05987b159a Changes to compile signing tools on darwin
The following works from a Mac with these changes:
make Q= ARCH=arm HAVE_MACOS=1 `pwd`/build/futility/futility

Only vbutil_keyblock and vbutil_kernel have been exercised.

BUG=none
TEST='make Q= ARCH=arm HAVE_MACOS=1 `pwd`/build/futility/futility'
BRANCH=none

Signed-off-by: David Riley <davidriley@chromium.org>

Change-Id: Ie69cfee0c650d4ff96be6322083a2fea1543ee39
Reviewed-on: https://chromium-review.googlesource.com/246773
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: David Riley <davidriley@chromium.org>
Commit-Queue: David Riley <davidriley@chromium.org>
2015-02-11 23:05:39 +00:00
Bill Richardson
7ccd9ce48e futility: handle truncated BIOS images without segfault
A truncated BIOS with an otherwise valid FMAP that now points way
off the end of the file shouldn't cause coredumps.

BUG=none
BRANCH=ToT
TEST=make runtests

Change-Id: Idf96e1e6a381bf0fe0b1cb2d16e3dad39ce7a0dc
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/245500
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-02-03 05:39:19 +00:00
Bill Richardson
2559338dbd futility: refactor file type detection into new files
This moves the what-kind-of-file-is-this logic into a separate
file, and makes it work by calling distinct recognizers until one
hits. A new "-t" option to the show command prints what it's
doing.

BUG=chromium:228932
BRANCH=ToT
TEST=make runtests

Change-Id: Id8f60bdf3fe6a9adf41b4555b3448a261fa52fea
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/245122
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-01-31 05:42:48 +00:00
Bill Richardson
b406c1064b futility: Don't copy the entire kernel partition just to sign a blob
When re-signing a kernel partition and writing the result into a
new file, make sure we only emit the vblock and kernel blob
instead of creating a new file that's the size of the entire
partition.

Also add a test for that.

BUG=chromium:418647
BRANCH=none
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I2c42aec6816e7e7abbeed360089c9b51fdcfe786
Reviewed-on: https://chromium-review.googlesource.com/233039
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-12-04 05:08:21 +00:00
Bill Richardson
6df3e33912 Add hwid digest field to GBB header
This adds a field in the GBB header to store the sha256 digest of
the HWID string, and updates gbb_utility so that it stores the
digest when it modifies the HWID. Because this is a new field,
the GBB_MINOR_VER is incremented.

BUG=chromium:415227
BRANCH=ToT
TEST=make runtests, VBOOT2=1 make runtests

Since the GBB is in the RO firmware, there should be no side
effects for existing devices (but even without that, they should
handle a minor version change without complaint).

Change-Id: Icdb2a0b564677b0b65e58df897d2ec5af3964998
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221360
2014-10-21 22:44:12 +00:00
Bill Richardson
e192e7f6ce futility: clean up a few shared functions
Move the Debug() function into a common place instead of several
copies in different files, rename shared functions to start with
"futil_"

BUG=none
BRANCH=ToT
TEST=make runtests

Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Change-Id: I6b844553dff95c24894dae611102716a8da5312d
Reviewed-on: https://chromium-review.googlesource.com/219645
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-25 20:26:53 +00:00
Bill Richardson
779796f57e futility: Improve help messages
This provides help messages for the futility commands similar to
the way git does. These show the available commands:

  futility
  futility help
  futility --help

While these show help for a specific command:

  futility help COMMAND
  futility --help COMMAND
  futility COMMAND --help

BUG=none
BRANCH=ToT
TEST=manual

make runtests

And manually look at help messages for each command.

Change-Id: I1126471e242784c6ca7a2f11694fa7c505d833e8
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/219528
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-24 00:59:02 +00:00
Bill Richardson
15dc6fc5ea futility: add "sign" command to resign firmware images
The "sign" command can perform the same operation as the old
resign_firmwarefd.sh script, only about 20 times faster. The
test for that will use the new command instead.

BUG=chromium:224734
BRANCH=ToT
TEST=make runtests

Change-Id: Ie7f7a0ab6fc00d7e06cb263733bf6e7246fdb023
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/216227
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-05 09:58:35 +00:00
Bill Richardson
cf6e78dbd5 futility: the show command can traverse all file types
It doesn't yet handle block devices, but it can display normal files
containing a entire BIOS image, a GBB, a VBLOCK, a .vbpubk, a .vblock,
and a firmware preamble (VbFirmwarePreambleHeader).

The command-line options are not well-documented.

BUG=chromium:224734
BRANCH=ToT
TEST=make runtests

Change-Id: I181f6331ae23599302bbaee3f270e8af9586cf06
Reviewed-on: https://chromium-review.googlesource.com/216032
Commit-Queue: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2014-09-03 22:49:52 +00:00