Commit Graph

1739 Commits

Author SHA1 Message Date
Eric Caruso
1919b169bf image_signing: change files sign_oci_container looks for
Since we're packing containers in a format imageloader understands,
we need to consume imageloader's manifest and produce a signature
it knows to look for.

BRANCH=ToT
BUG=chromium:697645
TEST=package adb container, verify imageloader.sig.2 is present

Change-Id: Ied9cdacf1d448a094c1b171bc2bf3b2ae54eb517
Reviewed-on: https://chromium-review.googlesource.com/457102
Commit-Ready: Eric Caruso <ejcaruso@chromium.org>
Tested-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2017-04-26 16:19:51 -07:00
Mike Frysinger
510e7a2b03 devkeys: switch container key from RSA to EC
Created by doing:
  openssl ecparam -name prime256v1 -out prime256v1.pem
  openssl ecparam -genkey -noout -out cros-oci-container.pem -in prime256v1.pem
  openssl pkey -in cros-oci-container.pem -out cros-oci-container-pub.pem -pubout

BUG=chromium:660209
TEST=`./sign_official_build.sh oci-container fastboot/ ../tests/devkeys` still works
BRANCH=None

Change-Id: I4171b2d9d9788cccf082d613b1de6e7ca9d0b005
Reviewed-on: https://chromium-review.googlesource.com/461418
Commit-Ready: Dylan Reid <dgreid@chromium.org>
Tested-by: Dylan Reid <dgreid@chromium.org>
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
2017-04-26 16:19:50 -07:00
Bill Richardson
748af73c67 Add missing arg to debug message
BUG=none
BRANCH=all
TEST=none

Change-Id: Ic7b318fbc05a2b25f4923d08381186c8b37a5999
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/475117
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-04-12 20:22:36 -07:00
Shelley Chen
fa0f483782 detachables: Define VbExDisplayMenu()
Create new callback for drawing detachable firmware menus

BUG=b:35585623
BRANCH=None
TEST=None

Change-Id: Ief207f6119f00151e2d480549aaac3a8755cb1b4
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457838
Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
2017-03-29 13:43:11 -07:00
Victor Hsieh
cfbc083efe Preserve compress method when re-sign Android image
TEST=sign_android_image.sh rootfs /path/to/tests/devkeys/android
     # unsquash -s still shows gzip (previous script always use lzo)
BUG=chromium:705247
BRANCH=none

Change-Id: If95686d293123a069ce36bc53cbea3a08aa3e7ab
Reviewed-on: https://chromium-review.googlesource.com/461205
Commit-Ready: Victor Hsieh <victorhsieh@chromium.org>
Tested-by: Victor Hsieh <victorhsieh@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
2017-03-28 17:16:52 -07:00
Nicolas Boichat
a1c5f7c006 vboot_reference: Add support for 3072-bit exponent 3 keys
This also adds the required tests (keys, testcases), and some
additional tests in vb2_rsa_utility_tests.c that were not
added when 2048-bit exponent 3 support was added.

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

Change-Id: I56d22302c2254ef500b9d2d290a79d8c8bc39942
Reviewed-on: https://chromium-review.googlesource.com/449060
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-16 11:25:47 -07:00
Nicolas Boichat
114ac2079e vbutil_keyblock: Force checking the signature if signpubkey is provided
Previously, futility vbutil_keyblock --unpack would just ignore the error
if the keyblock was not signed (but a signing public key was provided).

This fix would have caught the regression introduced by
939cc3a "futility: Use only vboot 2.0 APIs for keyblocks"

BUG=chromium:611535
BRANCH=none
TEST=make runtests on m/master => fails
TEST=make runtests with CL:448399 => succeeds

Change-Id: Id7f0a248863aae2f41c2fa46fbb8a37848e707a9
Reviewed-on: https://chromium-review.googlesource.com/449058
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-16 11:25:47 -07:00
Nicolas Boichat
e0a3f85a46 host_keyblock: Fix vb2_create_keyblock_external
939cc3a "futility: Use only vboot 2.0 APIs for keyblocks" introduced
2 subtle bugs, and we could still pass unit tests. Until we start
adding more signing algorithms and sig_data_size != 0.

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

Change-Id: Ief95e5ab773185b59276cf06d1efaa29f1212466
Reviewed-on: https://chromium-review.googlesource.com/448399
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-16 11:25:46 -07:00
Shelley Chen
50d1282e85 poppy: center detachable menu text
BUG=b:35585623
BRANCH=None
TEST=reboot and make sure menu is centered in fw screen
CQ-DEPEND=CL:447818

Change-Id: I7ce5063adab978338af18ad2befe65107fdea21f
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/447838
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 22:02:21 -08:00
Shelley Chen
97a8aa97c3 poppy: define VbExDisplayGetDimension()
callback to get rows/cols of display

BUG=b:35585623
BRANCH=None
TEST=make sure code compiles

Change-Id: I276975b2f0eecceb66a30ceaa449ab76a440026d
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/447837
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 09:33:57 -08:00
Shelley Chen
48a67d3ca7 poppy: Disable arrow keys for language switch
Previously, could use arrow keys to change language
in fw screen.  Disabling this in detachable menu
because will be using menu to switch languages.

BUG=b:35585623
BRANCH=None
TEST=reboot and try to use right/left arrows.  Make
     sure they don't do anything.

Change-Id: Ic720ea4ec9e6b7ae1676fdf60d27e2c74e48f736
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/444945
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 09:33:57 -08:00
Shelley Chen
05f0058479 poppy: use return key for selection
Replacing right arrow key with return for selection
when keyboard is available because it's more obvious.

BUG=b:35585623
BRANCH=None
TEST=reboot and make sure return selects menu item.

Change-Id: I6b2fbd8cddcd98c49638a6b9d79b47da1ca6545f
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/444944
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 09:33:57 -08:00
Shelley Chen
19a41188cd poppy: reinstating fw ctrl functions
Putting ctrl+D, ctrl+U, ctrl+L shortcuts
back in from the fw screens.

BUG=b:35585623
BRANCH=None
TEST=reboot and try ctrl+D, etc. in fw screen to
     make sure that they have desired effects.

Change-Id: I5ca555658eddabeeea6a2f64794e6839f35d75f7
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/443349
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 09:33:57 -08:00
Shelley Chen
e6198e7fc0 vboot_ui_menu: getting rid of explicit function print
Since we're now using VB2_DEBUG, no need to explicitly
print out __func__ anymore.

BUG=b:35585623
BRANCH=None
TEST=reboot and make sure still see serial output in
     AP console.

Change-Id: Ica524d4e50c61681e466815ffb93d33ceee215aa
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/443348
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 09:33:56 -08:00
Shelley Chen
ea97468d8a poppy: replacing dev warn & rec screens with base
Using new base screen only and leaving center
blank for displaying the detachable menu items.

BUG=b:35585623
BRANCH=None
TEST=reboot and make sure icons don't show up
     in FW screens.

Change-Id: I705dac43441f386ebceb58533fa0e336541fcd3c
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/442692
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-02 09:33:56 -08:00
Shelley Chen
b6ce9d095e poppy: defining base screen enum item
BUG=b:35585623
BRANCH=None
TEST=None

Change-Id: I2bb7f3f3cb8fd37f8a7c2253e1ea0cb322d01c9c
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/442691
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-03-01 18:42:22 -08:00
Shelley Chen
04b42e9612 poppy: Highlight menu selection
Reverse foreground/background colors for
highlighted selection.

BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and make sure selection is highlighted
CQ-DEPEND=CL:442747

Change-Id: Iaf33cf6140a3ce774a67e3ac7d381d5e05feeddb
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/442690
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-27 12:03:18 -08:00
Shelley Chen
5c4c4678e7 poppy: add highlight param to VbExDisplayText()
BUG=chrome-os-partner:61275
BRANCH=None
TEST=None
CQ-DEPEND=CL:442747,CL:442690

Change-Id: I0730b64a1f8bf1f4aeca1be5ee87724d61818b23
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/442689
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-27 12:03:18 -08:00
Nicolas Boichat
7c5d3b2240 futility: rwsig: Add support for images with FMAP
If an FMAP is detected in the rwsig image file, use it
to determine the location of:
 - RW region
 - RW signature
 - public key in RO region

futility show uses that information to verify the signature,
and futility sign uses it is correctly resign the image,
and replace the public key a well.

This also adds tests for this use case. hammer_dev.bin sample
image uses huge RO public key and RW signature regions to make
sure all keys up to RSA-8192 can be used.

BRANCH=none
BUG=chrome-os-partner:62321
TEST=make -j
TEST=./build/futility/futility --debug show \
                    --pubkey hammer.vbpubk2 hammer.bin
TEST=./build/futility/futility --debug show hammer.bin
TEST=cp hammer.bin hammer.bin.orig
     ./build/futility/futility --debug sign \
       --prikey hammer.vbprik2 hammer.bin
     diff hammer.bin hammer.bin.orig => identical
TEST=openssl genrsa -3 -out hammer2.pem 2048
     futility create --desc="Hammer 2nd key" hammer2.pem \
       hammer2
     ./build/futility/futility --debug sign \
       --version 2 --prikey hammer2.vbprik2 hammer.bin
     These 2 commands succeed, but show different keys:
     ./build/futility/futility --debug show hammer.bin
     ./build/futility/futility --debug show hammer.bin.orig
TEST=make runtests

Change-Id: I2cebc421eaf97d1b92c9a58afc238d41487d0f6d
Reviewed-on: https://chromium-review.googlesource.com/445536
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-25 10:32:03 -08:00
Nicolas Boichat
dec50797af cmd_sign/rwsig: Free sign_option.prikey in the main function
It's better to free it in the same function as it was allocated.

BRANCH=none
BUG=none
TEST=make runtests

Change-Id: I7a224364c4b1afce5a274b944d32fc1b7ba5db30
Reviewed-on: https://chromium-review.googlesource.com/446177
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-25 10:32:03 -08:00
Jeffy Chen
b1b5cf7ee8 cgpt: find: filter out more devices before touching them
A partition's name would always start with the disk name. And in
/proc/partitions, the partitions are always listed right after the
disk.

Let's filter out devices which are not followed by partitions when
go through the /proc/partitions.

BUG=chrome-os-partner:62955
TEST=run "cgpt find -t kernel" on kevin, no more this warning:
blk_update_request: I/O error, dev mmcblk0rpmb

Change-Id: If200a2476d26b1beaf644838d47ea2e60552855e
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Reviewed-on: https://chromium-review.googlesource.com/444492
Reviewed-by: Julius Werner <jwerner@chromium.org>
2017-02-24 05:42:55 -08:00
Nicolas Boichat
83bd850f3f vboot_reference: Add support for 2048-bit exponent 3 keys
This also adds the required tests (keys, testcases).

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

Change-Id: I5e148f8792ea325f813d76089271f3c4bcc2935d
Reviewed-on: https://chromium-review.googlesource.com/438951
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-18 00:39:28 -08:00
Nicolas Boichat
94bd5c5069 futility: create: Output "wrote XX.vb[pub|pri]k" to stdout
Let's keep stderr for actual errors.

BRANCH=none
BUG=chromium:690773
TEST=make runtests
TEST=futility create key.pem out > /dev/null is quiet

Change-Id: Id7ce658a0dc08f45d4d035b68e355e49d9717674
Reviewed-on: https://chromium-review.googlesource.com/442524
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-15 10:47:35 -08:00
Nicolas Boichat
8c53e881f8 host_key2: Add VB2_SIG_ALG_COUNT to count the number of valid signatures
More reliable than simply assuming that VB2_SIG_RSA8192 is the last
signature.

BRANCH=none
BUG=chromium:684354
TEST=rm tests/testkeys/key_*; make genkeys -j
TEST=make runtests -j

Change-Id: I755b3afb50313fcdf292fb3cd5b0dfe09f8593e3
Reviewed-on: https://chromium-review.googlesource.com/438948
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-15 10:47:29 -08:00
Randall Spangler
c7282f6bdc rollback_index: Add disable-ccd-unlock FWMP flag
This flag will be used by cr50 to disable case-closed debugging
unlock.  Here, we're just defining the flag.

BUG=chrome-os-partner:62205
BRANCH=reef
TEST=build_packages --board=reef chromeos_firmware

Change-Id: If86e112948e1c95a767808b2f92dd8fe35abf46c
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/440846
Reviewed-by: Shelley Chen <shchen@chromium.org>
2017-02-14 14:50:40 -08:00
Shelley Chen
00dee97036 poppy: initializing next_menu_idx to current_menu_idx
Get rid of uninitialized variable warning.

BUG=chrome-os-partner:61275
BRANCH=None
TEST=make cgpt WERROR= STATIC=1

Change-Id: I31faa557406c6a90cfdea8571620675c81c0c0ec
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/440432
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2017-02-11 19:53:40 -08:00
Nicolas Boichat
f310106030 tests: Add simple test for rwsig images
This tests that futility can correctly create and verify rwsig images.
Note that we do not test RSA 8192, as the signature is longer than
1024 bytes, and the test logic would need to be changed.

BRANCH=none
BUG=chromium:684354
TEST=make runfutiltests

Change-Id: I690e59fe8fa3e273dd81176211c58e1677fa720f
Reviewed-on: https://chromium-review.googlesource.com/438950
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-11 04:21:57 -08:00
Nicolas Boichat
3ac811d4a5 gen_test_keys.sh: Fixup key_index when keys already exist
BRANCH=none
BUG=chromium:684354
TEST=rm tests/testkeys/key_rsa2048*; make genkeys -j8

Change-Id: I6c75d2d54faf7a02c8fc4ef1ccc8647809c1aae8
Reviewed-on: https://chromium-review.googlesource.com/438949
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-11 02:42:02 -08:00
Nicolas Boichat
0bde10afbf signature_digest/SignatureDigest: convert vb2_crypto to hash algorithm
We were passing the wrong value to PrependDigestInfo. Let's also refactor
the function a little bit.

BRANCH=none
BUG=chromium:689371
TEST=make gentestcases; git status => no change

Change-Id: I0244c3f3de05b33b7ddd21e93a266faf34f2c239
Reviewed-on: https://chromium-review.googlesource.com/439086
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2017-02-11 02:42:01 -08:00
Nicolas Boichat
d02ae3899c Makefile: Add gentestcases target
This calls gen_test_cases.sh in the proper environment.

Also, prevent gen_test_cases.sh from overriding test_file, to
provide stable signature (and avoid large git diff for no reason).

BRANCH=none
BUG=chromium:684354
TEST=make gentestcases -j8; git diff => no changes

Change-Id: I556285fd1a07a4d84f4ebd3fd7881ae06743716e
Reviewed-on: https://chromium-review.googlesource.com/439064
Commit-Ready: Nicolas Boichat <drinkcat@chromium.org>
Tested-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-02-11 02:42:01 -08:00
Shelley Chen
791267a561 poppy: Converting all // comments to /* */
Also, ensuring comments start with capital letter.

BUG=chrome-os-partner:61275
BRANCH=None
TEST=None.  No functionality change.

Change-Id: I961236e2b6d95cf0281cd4e3313f465bf12ead9f
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/434250
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-30 16:48:36 -08:00
Shelley Chen
56ca279c58 poppy: Moving menu placement higher
Prevent scrolling off for low res displays

BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot snappy and make sure menu doesn't cause
     screen to scroll.

Change-Id: Ic5641c7c43ab3872dcb321df2629e228e86ddbb6
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/434249
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-30 16:48:36 -08:00
Shelley Chen
469d36aff5 poppy: Check NULL menu_array params in vb2_get_current_menu_size()
BUG=chrome-os-partner:61275
BRANCH=None
TEST=None

Change-Id: I1d88e552a4c9184061207a8e14e32dfb1a39745a
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/434248
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-30 16:48:35 -08:00
Shelley Chen
8496157c62 poppy: Adding kernel-doc comments
BUG=chrome-os-partner:61275
BRANCH=None
TEST=None.  No functionality change.

Change-Id: I00bb1924e22f398e1b614789dd0cd068ce51cc5d
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/434247
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-30 16:48:35 -08:00
Shelley Chen
53f8202a2a firmware: Using power button for selection
BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and try to make selections in detachable
     UI with power button.

Change-Id: I0a3178eb3fa2c8c1ed77d96fdefa948eaea508e5
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/427220
2017-01-24 17:18:00 -08:00
Shelley Chen
666bd54416 firmware: Prevent wraparound when scrolling through menus
BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and scroll to ends of menus to make sure that
     they don't wraparound.

Change-Id: I9ba83b23939140d23fe54858b9a10f873091ff72
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/426410
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-24 10:21:27 -08:00
Shelley Chen
0d82853f3b firmware: set fw screen default selection
BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and scroll through menus to make sure
     defaults to power off in all menus.

Change-Id: I21e6c24c43a46e9e79001857c1dec9869a07d61a
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/426409
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-24 10:21:27 -08:00
Shelley Chen
4de0c43b1c firmware: Adding vol up/down ascii definitions
BUG=chrome-os-partner:61275
BRANCH=None
TEST=test vol up/down keys and see if menu changes.

Change-Id: I2213639d530f954f12040b14bf2e5cdeb5c03218
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/426408
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-24 01:31:04 -08:00
Randall Spangler
a609478d1a 2lib: add VB2_DEBUG_RAW() to print without function name
Currently, VB2_DEBUG() will print the function name as a prefix to the
debug output.  Add VB2_DEBUG_RAW() to print without that, so that it's
possible to print little bits of debug output.  Use this in ec_sync to
hex dump the hashes.

And then clean up all of the debug calls which explicitly did things like:
    VB2_DEBUG("%s: foo", __func__);
to just:
    VB2_DEBUG("foo");
so they don't double-print the function name

BUG=chromium:683391
BRANCH=none
TEST=build_packages --board=reef chromeos-firmware &&
     DEBUG=1 make -j runtests
CQ-DEPEND=CL:430978,CL:431111

Change-Id: I0c35519d2e670d55d65d01eaa60d61f3e3edf419
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/431171
Reviewed-by: Julius Werner <jwerner@chromium.org>
2017-01-20 22:40:31 -08:00
Shelley Chen
1a03740bb0 firmware: calling menu ui when using detachables
BUG=chrome-os-partner:61275
BRANCH=None
TEST=compile depthcharge with
     inflags=VB_SALK_INFLAGS_ENABLE_DETACHABLE_UI and run.

Change-Id: I4c2351feef51bbf88fefd37986de6f853cd1942e
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424091
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-18 22:51:49 -08:00
Shelley Chen
1ceb361d60 firmware: fixing menu artifacts during printing
BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and switch menus and make sure everything
     is printing out properly.

Change-Id: I1269d3dc762a66dde0203673b7b400aba92afa75
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424356
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-18 19:17:56 -08:00
Shelley Chen
9f1d423890 firmware: adding support for language menu
BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot and try selecting language menu.

Change-Id: I3ec208578aec0ccaa92e17e4589ebeae250dae4f
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424355
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-18 19:17:55 -08:00
Shelley Chen
755bf33ad1 firmware: Add recovery menu support for detachables
Adding in basic menu support (using arrow keys) for
detachables.  This is specifically for the recovery menu.

BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot into recovery and try booting into developer mode.

Change-Id: I9596cde62f2748928b4b796bde0a0226dc981235
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424354
2017-01-18 19:17:53 -08:00
Shelley Chen
71c6c033f9 firmware: Add developer menu support for detachables
Adding in basic menu support (using arrow keys)
for detachables, which do not have keyboards.  Thus,
we can only do menu scrolling rather than the old
ctrl+D/U/L way.  This is specifically for the developer
warning menu.

BUG=chrome-os-partner:61275
BRANCH=None
TEST=reboot system and try scrolling through menu

Change-Id: I39f56f5ca2fedd47df53ab246ec357d07c9c4af0
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424353
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-18 19:17:52 -08:00
Randall Spangler
e02a19a6c2 vboot: fix compiling with DEBUG=1
If FOR_TEST is defined, 2common.h defines VB2_DEBUG() to be printf();
it should include stdio.h as well.

The HOSTLIB extern linktest links against the vboot1 stub functions,
but not the vboot2 stub functions, so it couldn't find vb2ex_printf().

BUG=chromium:682058
BRANCH=none
TEST=DEBUG=1 make runtests; DEBUG=1 emerge-reef vboot_reference depthcharge

Change-Id: Ibf981a70ca4087ce3d86b02d76e03063b2cfc9e5
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/429310
Commit-Ready: Shelley Chen <shchen@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>
2017-01-18 19:17:50 -08:00
Mike Frysinger
62461d719f image_signing: support signing of OCI containers
BUG=chromium:660209
TEST=`./sign_official_build.sh oci-container fastboot/ ../tests/devkeys` works
TEST=signing an image inserted the container pubkey
BRANCH=None

Change-Id: I75793b03e93f2c18b1495a3ec729ad04d2e17401
Reviewed-on: https://chromium-review.googlesource.com/427538
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Reviewed-by: David Riley <davidriley@chromium.org>
2017-01-14 20:19:06 -08:00
Shelley Chen
3409e60633 firmware: Adding VbExDisplayText function
Enables easy printing of text to display.
Will be used for detachable UI.

BUG=chrome-os-partner:61275
BRANCH=None
TEST=Tested from new vboot_ui_menu.c file
CQ-DEPEND=CL:424357

Change-Id: I668dd57eaafa02fb31f6ac479bcd03a613323f14
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/424090
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2017-01-13 21:48:34 -08:00
Randall Spangler
21015898b3 firmware: replace VBDEBUG(()) macro with VB2_DEBUG()
The original VBDEBUG macro used doubly-nested parens to work with
MSVC, which didn't support varargs in macros.  We now only use more
modern compilers, so replace it with the VB2_DEBUG macro and get rid
of the ugly and fragile double parens.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; build_packages --board=reef chromeos-firmware

Change-Id: Ifc0cb0733b14daaa1fde095fab7da4215a538c77
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/425133
Reviewed-by: Shelley Chen <shchen@chromium.org>
2017-01-12 15:56:27 -08:00
Randall Spangler
df4eb2bb7b firmware: Split out kernel UI
This moves the UI loops out of vboot_api_kernel.c into vboot_ui.c, so
that it'll be easier to support different UIs for different form factors.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; build_packages --board=reef chromeos-firmware; boot reef

Change-Id: I451b15f65aceb427ffdd94b19f44e91ebc10a860
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/414289
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Shelley Chen <shchen@chromium.org>
2017-01-12 15:56:26 -08:00
Randall Spangler
ad7a75531e firmware: Remove LoadKernelParams from APIs
This cleans up the vboot functions which handle display so they don't
need to pass it around.  Eventually, it'll be absorbed by vb2_context.

BUG=chromium:611535
BRANCH=none
TEST=make runtests; build_packages --board=reef chromeos-firmware; boot reef

Change-Id: I58169dfd37abe657f9b9aa339cc72ffa398329e0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/414288
Reviewed-by: Shelley Chen <shchen@chromium.org>
2017-01-12 15:56:24 -08:00