History log of /external/vboot_reference/firmware/2lib/2misc.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
62d482ecddf5735076a085859cf40fcfa24671ee 29-Jan-2015 Daisuke Nojiri <dnojiri@chromium.org> add vb2api_get_pcr_digest

this api allows firmware to get the digest indicating boot mode status.

BUG=chromium:451609
TEST=VBOOT2=1 make run2tests
BRANCH=tot

Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Idca7bc5f6aed947689ad7cf219805aad35047c7d
Reviewed-on: https://chromium-review.googlesource.com/244542
/external/vboot_reference/firmware/2lib/2misc.c
6f1b82ac14f341d9733d6e95d518b3ee352002ef 03-Dec-2014 Randall Spangler <rspangler@chromium.org> vboot2: Move old struct handling to lib20/

This is part 4 of a series of changes to rearrange the vboot2 library
so that it's possible to start using the new-style data structs. This
change moves knowledge of the old vboot1 data structs into lib20; 2lib
now contains only code which is common to both vboot2.x libraries
(that is, code which is data structure version agnostic).

No functional changes; just rearranging code and tests.

BUG=chromium:423882
BRANCH=none
TEST=make runtests && VBOOT2=1 make runtests (works with/withoug VBOOT2 flag)
And compile firmware for veyron_pinky
CQ-DEPEND=CL:233051

Change-Id: I8f9e67157575e5be14952ef4809c3dfafd92596d
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/233021
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
941e25fa59816cf6ae32a585b013f671eccbd813 29-Oct-2014 Aaron Durbin <adurbin@chromium.org> vb2: parse dev mode in phase1

The rest of the system software expects dev mode to be
orthogonal to recovery mode. However, vb2_fw_phase1() was
only checking recovery mode. The caller would then not
call vb2_fw_phase2() which checked the developer mode settings.
Fix this by doing the necessary steps in vb2_fw_phase1().

BUG=chrome-os-partner:33264
BRANCH=None
TEST=None yet.

Change-Id: I06da388c3ca33754ddb5937a2877fbc287946490
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/225906
Tested-by: Furquan Shaikh <furquan@chromium.org>
Commit-Queue: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Tested-by: Benson Leung <bleung@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
d274a2e9536907d0474d988f32f602cd64ed1ae6 24-Oct-2014 Randall Spangler <rspangler@chromium.org> vboot2: Add vb2_unpack_key2() and unit tests

This unpacks new-style packed keys.

For now, it can also handle old-style packed keys by passing them to
the old unpacking function. Once we've switched over to new-style
keys in the signing scripts, we'll remove the old format to save code
size.

Also added is a test library which converts from old to new struct
formats. That should eventually get absorbed into futility, and the
test keys directory should have both old and new format packed keys in
it.

BUG=chromium:423882
BRANCH=none
TEST=VBOOT2=1 make runtests

Change-Id: I0fe31f124781d1ea1efedab65dcd6130bfca18dd
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225490
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
f18038b750c43c2185e64db38d0d244c6810083b 24-Oct-2014 Randall Spangler <rspangler@chromium.org> vboot2: Move and rename functions

Move packed key functions to their own file, in preparation for
introducing support for vb2_packed_key2.

Rename the awfully-named vb2_verify_fw_preamble2() function to
vb2_load_fw_premable(), since the new structs actually have a
vb2_fw_preamble2 struct and that would be very confusing.

Rename vb2_verify_fw_keyblock() to vb2_load_fw_keyblock(), so it
matches.

No functional changes, just renaming.

BUG=chromium:423882
BRANCH=none
TEST=VBOOT2=1 make runtests

Change-Id: Ia914e48e6c5814ab3205b999ceda1aa2452206ff
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225458
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
9e39efd6474449ec38bb2bcc2209a070fb6e6937 23-Oct-2014 Julius Werner <jwerner@chromium.org> vboot2: Log recovery reason and subcode to console

Looks like vboot2 currently never outputs the current recovery reason
anywhere, which is annoying for debugging devices without working
display (where you could press TAB). This patch adds log messages both
when deciding to go into recovery mode and when picking up an existing
recovery request from NVRAM, for maximum visibility.

Also removes the "Both slots are bad." part of the vb2_fail() message,
since this is not necessarily true and can be confusing (there are many
other possible reasons why it might want to go into recovery).

BRANCH=ToT
BUG=None
TEST=Manual

Change-Id: Ic98c61223dce00e830ea0f199878d47b214bb224
Signed-off-by: Julius Werner <jwerner@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225160
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
b035e370a7ca315d1e4d249274893ef11bcac700 23-Oct-2014 Randall Spangler <rspangler@chromium.org> vboot2: Fix broken compatiblity check for gbb header 1.1

vboot2 supports only GBB header versions 1.1+. When the GBB header
was rev'd to 1.2, this broke the compatibility check for 1.1.
However, the test was written in such a way that wasn't detected. Fix
the check and the test.

BUG=chromium:415227
BRANCH=none
TEST=VBOOT2=1 make runtests

Change-Id: Ifeb1f21bf5cf3cc05d31ac7912693e090eb8fd5e
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225110
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
782300d093a2fbf2ca24e446fb6d65f9f28e56a6 23-Sep-2014 Randall Spangler <rspangler@chromium.org> vboot2: Add previously tried slot and result to NV storage

This gives recovery mode information on two boots back instead of one,
which may be handy for debugging.

It also allows determining whether a failure of the current boot
should try the other slot or go to recovery, using only information
stored in NV storage.

Added crossystem support for printing the fields, and unit tests.

BUG=chrome-os-partner:32585
BRANCH=none
TEST=make runtests; VBOOT2=1 make runtests

Change-Id: Ia9f4186210d30217b902db7c513ae4ab8851f8f4
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221230
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
d300ca81318ed7825632e72b77b076cda73d4efa 02-Oct-2014 Randall Spangler <rspangler@chromium.org> vboot2: Fix saving the slot we tried back to nv storage

Previously, we only kept that slot info in RAM. We read it from NV
storage, but never wrote it back.

Added a test to confirm proper behavior (and made sure it failed
before patching 2misc.c with the fix).

BUG=chrome-os-partner:32583
BRANCH=none
TEST=VBOOT2=1 make runtests

Change-Id: Ie12124d9cbe417914fbde14ea5086380d637240f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221214
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
fc17308c39d23fe64959854dc5a858429b37539f 24-Jun-2014 Daisuke Nojiri <dnojiri@chromium.org> vboot2: Scramble the GBB magic number

Compiling in the GBB magic number as is causes any tools that search for the
number to fail. This patch allows firmware to embed XOR'ed signature.

TEST=Booted Nyan in normal mode. FAFT:firmware_DevMode passes.
BUG=none
BRANCH=none
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>

Change-Id: Id18905a9969af3db24151e7c51332d0e94405108
Reviewed-on: https://chromium-review.googlesource.com/205416
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
5b63803f6cfd55edb8cafa598aed9b9ec9d5211c 22-Jun-2014 Daisuke Nojiri <dnojiri@chromium.org> vboot2: Check necessity of recovery when firmware body hash fails to match

TEST=Booted Nyan Blaze and verified recovery is requested.
BUG=None
BRANCH=none
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>

Change-Id: I076e9714de4b853973cadad9a02a35d28431790c
Reviewed-on: https://chromium-review.googlesource.com/205156
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
1803068173a625efd83d1cee8dd90843feb0d972 12-Jun-2014 Randall Spangler <rspangler@chromium.org> vboot2: misc higher-level routines, part 2

I'm breaking the last chunk of vboot2 into smaller pieces as I add
tests. This has the higher-level routines for verifying keyblock and
preamble.

BUG=chromium:370082
BRANCH=none
TEST=make clean && VBOOT2=1 COV=1 make

Change-Id: I82da9542c8857a3f89a85f206c9f5aecadf94a79
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/203501
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
da2b49cf08a27551fd910626f669910a636378d4 11-Jun-2014 Randall Spangler <rspangler@chromium.org> vboot2: misc higher-level routines

I'm breaking the last chunk of vboot2 into smaller pieces as I add
tests. This has a bunch of misc routines like the dev switch logic
and GBB header parsing.

BUG=chromium:370082
BRANCH=none
TEST=make clean && VBOOT2=1 COV=1 make

Change-Id: I0f67400d9b59ec21ed5cc155a9b774fd37eb559b
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/203374
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
224f5ac761852cd9ffe56438f6807732bd9ee445 06-Jun-2014 Randall Spangler <rspangler@chromium.org> vboot2: Use more specific error codes, part 3

Error codes reported by 2common.c are now very specific, and tests
verify the proper errors are reported.

BUG=chromium:370082
BRANCH=none
TEST=make clean && VBOOT2=1 COV=1 make

Change-Id: I9480bd22b60ae339196c92918a8a984a9f05ac1a
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202938
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c
3333e578497aafc4eb8c6e1e359f6e2b1dee633a 14-May-2014 Randall Spangler <rspangler@chromium.org> vboot2: Add nvstorage and secdata functions

This is the second of several CLs adding a more memory- and
code-efficient firmware verification library.

BUG=chromium:370082
BRANCH=none
TEST=make clean && COV=1 make

Change-Id: I1dd571e7511bff18469707d5a2e90068e68e0d6f
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/199841
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
/external/vboot_reference/firmware/2lib/2misc.c