summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* test: Make TEST_EQ print either 'comment' or 'desc'stabilize-8872.70.Bstabilize-8872.6.Bstabilize-8872.40.Bstabilize-8872.15.Brelease-R55-8872.BDaisuke Nojiri2016-10-051-4/+4
| | | | | | | | | | | | | | | Currently, test macros print out 'desc' regardless 'comment' is specified or not. This patch makes TEST_EQ print 'desc' only if 'comment' is not supplied. BUG=none BRANCH=none TEST=make runtests Change-Id: I9cc3c9a9561534352ae0315dfea983f2c212b909 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388859 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add test for futility bdb --resignDaisuke Nojiri2016-10-051-0/+16
| | | | | | | | | | | BUG=chromium:649554 BRANCH=none TEST=make runtests Change-Id: Id33911a1a05375f860c38ee6df3f98fa59066acf Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388734 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add test for futility bdb --addDaisuke Nojiri2016-10-051-0/+6
| | | | | | | | | | | BUG=chromium:649554 BRANCH=none TEST=make runtests Change-Id: Ie774a64e9abd6de8f0f96567f6f6a2e930a8624c Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388733 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add test for futility bdb --create and --verifyDaisuke Nojiri2016-10-054-0/+39
| | | | | | | | | | | | | This script will be testing futility bdb command. BUG=chromium:649554 BRANCH=none TEST=make runtests Change-Id: I3c5b9f9564b3cc67cac4eca02798b8146feeb072 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388732 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Make 'futility show' support BDBDaisuke Nojiri2016-10-047-1/+77
| | | | | | | | | | | | | | This patch makes futility show command support boot block descriptor (BDB) of the common boot flow. BUG=chromium:649554 BRANCH=none TEST=make runtests. Ran futility show bdb.bin. Change-Id: I5f199a32ab1c268351e822e37ed39e41ae19bc7a Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388631 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add 'bdb --verify' to futilityDaisuke Nojiri2016-10-041-4/+53
| | | | | | | | | | | | | | | This patch adds 'verify' sub-command to futility bdb. It verifies a BDB. If a key digest is given, it also checks the validity of the embedded BDB key. BUG=chromium:649554 BRANCH=none TEST=make runtests. Ran futility bdb --create, --add, --resign, --verify. Change-Id: Ie19dc0f067c3c6ce65b2b6184bad14b49b188f6d Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387906 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add 'bdb --resign' to futilityDaisuke Nojiri2016-10-044-10/+326
| | | | | | | | | | | | | | | | | 'resign' sub-command signs a BDB using keys provided. It can resign only the data key, the hashes, or both. Required keys vary depending on what part of BDB is invalid and on what public key is specified in the command line. It then detects what key is needed based on the verification result and fails if the required key is not provided. BUG=chromium:649554 BRANCH=none TEST=make runtests. Ran futility bdb --create, --add, --resign, --verify Change-Id: I589a5972f1d7e5066eb56e1c5efb4ee7089d41cd Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387118 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add 'bdb --add' to futilityDaisuke Nojiri2016-10-043-13/+77
| | | | | | | | | | | | | | | | futility bdb --add appends a new hash entry to the given BDB. The resulting BDB does not have a valid signature and is expected to be resigned by 'resign' sub-command after all hashes are added. BUG=chromium:649554 BRANCH=none TEST=make runtest. Ran futility bdb --add, then --resign, then --verify (to be implemented) Change-Id: Icdf185f8ac268a23bb3954f5e78df6f80e749e18 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387117 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Assign different codes for data validation errorsDaisuke Nojiri2016-10-043-4/+8
| | | | | | | | | | | | | | | | | This patch adds BDB_ERROR_DATA_CHECK_SIG and BD_ERROR_DATA_SIGNED_SIZE to distiniguish data signature validation errors. 'futility bdb --resign' uses these to decide whether to resign is needed or not. BUG=chromium:649554 BRANCH=none TEST=make runtests Change-Id: I19137801ece2424ae575092c51d02664c8b73ba3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/386795 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: add bdb --create command to futilityDaisuke Nojiri2016-10-042-4/+340
| | | | | | | | | | | | | | | | bdb command manipulates BDBs. '--create' sub-command creates a BDB. Other sub-commands will follow in the successive patches. BUG=chromium:649554 BRANCH=none TEST=make runtests. Ran futility bdb --create using test keys and verify it with bdb --verify (to be implemented). Change-Id: Ib0a6165ac93efc7478b9d999d3c837d47cf81ddd Reviewed-on: https://chromium-review.googlesource.com/386794 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Fix more coverity warningsRandall Spangler2016-10-018-28/+52
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I82ece2de948ef224115c408bdfc09445d3da119b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/390337 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* scripts: Improve make_dev_firmware and allow working with more MP firmware.Hung-Te Lin2016-10-011-10/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Verified boot has "TPM anti-rollback check" that prohibits booting firmware if the device has been installed with a firmware that has higher signing version. This is causing problems when people are trying to use make_dev_firmware script on MP devices (which usually has a higher version than DEV keyset, which is always 1). Previously, make_dev_firmware won't alert about this so developers will first see boot failure, figure out what happened, and then either uprev the devkeys folder manually (which we don't provide scripts on DUT so it's hard), or reset the device by using factory reset shim. Since make_dev_firmware already knows all information, it should check and increase version number automatically. This change has implemented checking and increasing 'firmware version'. The 'data key version' is also checked, but increasing that is more complicated and we probably don't have all required tools yet on DUT, so it is only checked. Also added one flag --[no]mod_hwid so MP device users can keep their HWID easier, when they need to switch back and forth between DEV / real MP firmware. BRANCH=none BUG=none TEST=Grab a firmware from daisy mp-v4.bin and do ./make_dev_firmware.sh -f bios.bin -t out.bin --nomod_hwid Change-Id: If81ef60e6debdcd1c6d899b5a2c03bdacb4fd4f7 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/390871 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* bdb: Add bdb_extendDaisuke Nojiri2016-10-014-10/+224
| | | | | | | | | | | | | bdb_extend prints out secrets derived from the given BDS based on the given BDB. BUG=chromium:649555 BRANCH=none TEST=make runtests. Ran bdb_extend -s bds.bin -b bdb.bin (with/without -m) Change-Id: I8d9f73468992dad4cb93a422c0eae0977be9a16f Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385539
* bdb: Add functions to get attributes of BDB componentsDaisuke Nojiri2016-10-012-1/+42
| | | | | | | | | | | | | | These APIs return size and offsets of BDB components. They help code look more descriptive. BUG=none BRANCH=none TEST=make runtests Change-Id: I29326e249d9f2b88d5716f878f8415703f63360c Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388813 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Add secret deriving code for SP-RODaisuke Nojiri2016-10-016-120/+302
| | | | | | | | | | | | | | | | | This patch adds code which dervies secrets from BDS. It's supposed to be done by SP-RO, hence the code is mostly useful for testing (or emulation). vba_extend_secrets_ro takes a function pointer to a hash extend function. It'll be used to try different sha256 extend algorithms. BUG=chromium:649555 BRANCH=none TEST=make runtests Change-Id: I8fef6b851fb84686d8bcdd948b36160016687c51 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/384354 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* bdb: Make bdb_verify accept null pointer for key digestDaisuke Nojiri2016-10-013-2/+10
| | | | | | | | | | | | | | | If key digest matching is not required (i.e. verify-bdb-key efuse flag is not set), bdb_verify skips digest matching. This change makes bdb_verify accept null pointer for the key digest parameter. BUG=chromium:649555 BRANCH=none TEST=make runtests Change-Id: I14e5bd02526684b7b7bca1e1701cf04056df83ea Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385538 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Revert "Change debug key signatures"Victor Hsieh2016-09-261-11/+5
| | | | | | | | | | | | | | | The lab use test image (non-signed) to run CTS, so we still need to switch key to make a test pass (which blacklist Google's dev key). This reverts commit b94145a309131f23d49a08dd94fc26247621da65. TEST=None BUG=b:29915721,b:31373710 Change-Id: I0873d13b606f3e49b9d055e9dd081d3dacd97c65 Reviewed-on: https://chromium-review.googlesource.com/388636 Commit-Ready: Victor Hsieh <victorhsieh@chromium.org> Tested-by: Victor Hsieh <victorhsieh@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* bdb: Define RSA symbols non-weaklyDaisuke Nojiri2016-09-262-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Defining these symbols weakly causes the output executable to hit segmentation fault because ld chooses *UND* symbols over the definition when they appear in *.a archive: $ objdump -t build/libvboot_utilbdb.a bdb.o: 0000000000000000 w *UND* 0000000000000000 bdb_rsa4096_verify ... rsa.o 000000000000061f w F .text 0000000000000111 bdb_rsa4096_verify ... This happens regardless whether the symbol is referenced or not; or whether the object defining the symbol appears earlier than the reference or not. BUG=none BRANCH=none TEST=make runtests Change-Id: Ib53a9010f2afdc2ba59369fb145aef4381db30d3 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/387905 Reviewed-by: Randall Spangler <rspangler@chromium.org>
* test: Print either 'comment' or 'desc'stabilize-8838.BDaisuke Nojiri2016-09-241-4/+4
| | | | | | | | | | | | | | | | Currently, test macros print out 'desc' regardless 'comment' is specified or not. This patch makes 'desc' printed out only if 'comment' is not supplied. BUG=none BRANCH=none TEST=make runtests Change-Id: I146d681b0d3cb7d41c7f80b71c59418a0250fc17 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385159 Commit-Ready: Randall Spangler <rspangler@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* Preserve file capabilities while signing AndroidLuis Hector Chavez2016-09-231-4/+8
| | | | | | | | | | | | | | | | | | | | The version of unsquashfs that is shipped with Trusty does not correctly file capabilities, even though the target filesystem supports them. This change forces the Android signer script to prefer the pre-built binaries for mksquashfs/unsquashfs in order for the file capabilities to be preserved. BUG=b:31630024 BRANCH=none TEST=Called sign_android_image.sh locally, saw capabilities preserved across repeated invocations. CQ-DEPEND=CL:*289356 Change-Id: I13e8782edb699eb4ce8bcf82885bd474f4351430 Reviewed-on: https://chromium-review.googlesource.com/387867 Commit-Ready: Luis Hector Chavez <lhchavez@google.com> Tested-by: Luis Hector Chavez <lhchavez@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Fix test failures when TPM2_MODE is definedBill Richardson2016-09-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An earlier commit had added this: ifeq (${TPM2_MODE},) # TODO(apronin): tests for TPM2 case? TEST_NAMES += \ tests/tlcl_tests \ tests/rollback_index2_tests endif but left this: .PHONY: runmisctests runmisctests: test_setup ${RUNTEST} ${BUILD_RUN}/tests/rollback_index2_tests [...] ${RUNTEST} ${BUILD_RUN}/tests/tlcl_tests So if TPM2_MODE is not null, those two test targets won't be built. This CL puts those two into the same guard, so that they won't be attempted if they're not built. BUG=chrome-os-partner:57727 BRANCH=all TEST=manual Before, this fails: FEATURES=test emerge-reef vboot_reference Now, it passes. Change-Id: Ic00f9f867d3d9c719d797907f00fda8bc5044504 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/388711 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* keygeneration: create_new_keys: add key-name/output optionsMike Frysinger2016-09-222-2/+37
| | | | | | | | | | | | | | We use these features on the signer, so move the logic here so it's in the public code. BUG=None TEST=`./create_new_keys.sh --key-name hihya --output foo --android` worked BRANCH=None Change-Id: I85d6fdbafd99a1b94bc90e26cbc17ba801614914 Reviewed-on: https://chromium-review.googlesource.com/388673 Reviewed-by: David Riley <davidriley@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* keygeneration: add --android option to generate keysMike Frysinger2016-09-202-3/+30
| | | | | | | | | | | BUG=b:29915721 TEST=`./create_new_keys.sh --android` includes android keys BRANCH=None Change-Id: Ibb00b87921435ac5b70a297324ddf60563dc08d8 Reviewed-on: https://chromium-review.googlesource.com/386905 Reviewed-by: Victor Hsieh <victorhsieh@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* tests: Fix coverity warningsRandall Spangler2016-09-1515-50/+102
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I927571f8a30794c70228506afe4da3eda86f765b Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/383953 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Fix more coverity warnings in utilitiesRandall Spangler2016-09-156-13/+38
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I8fcf0c51e33d5dc49f650f4069f1579091cf188d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/383713 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* utilities: Fix coverity warningsRandall Spangler2016-09-143-4/+12
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: Ifcb50b3dfcc3d376bf6803e9c06f8e68dafd51a0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/382611 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* futility/host lib: Fix coverity warningsRandall Spangler2016-09-1415-89/+140
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: Ib37b45dea54bd506b519b0304300b8d192e34339 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/382319 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* make_dev_firmware.sh should use key.versions filestabilize-8798.BBill Richardson2016-09-122-3/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'key.versions' file is used by the image signing scripts to ensure that newly generated keys and re-signed buildbot images have the correct version numbers to avoid rollback in officially-signed Chrome OS images. If a skilled user is re-keying her Chromebook to use personal keys in normal mode (which requires disabling WP and changing the GBB and VBLOCK_A/B), she can avoid clearing the TPM rollback counters if make_dev_firmware.sh will obtain the firmware_version from the key.versions file in her personal key directory. BUG=none BRANCH=none TEST=make runtests, manual tests Extract an MP-signed BIOS from a Chromebook Peppy. flashrom -p host -r peppy.bin Resign it without this CL: make_dev_firmware.sh -f peppy.bin -k tests/devkeys -t dev_peppy.bin Resign it with this CL: make_dev_firmware.sh -f peppy.bin -k tests/devkeys -t dev_peppy_new.bin Confirm no difference: cmp dev_peppy.bin dev_peppy_new.bin Temporarily edit tests/devkeys/key.versions to contain firmware_key_version=2 firmware_version=3 kernel_key_version=4 kernel_version=5 Resign again: make_dev_firmware.sh -f peppy.bin -k tests/devkeys -t dev_peppy_new2.bin Confirm that the only difference is the firmware version in VBLOCK_A/B: futility show dev_peppy_new*.bin Change-Id: I133f1b58fb969eaeb239a44a4800750c4eee1d5f Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/383887 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Change debug key signaturesVictor Hsieh2016-09-091-5/+11
| | | | | | | | | | | | | | We switched to different debug keys so the signature needs to be updated. TEST=sign_official_image with the new recovery image, failed before this change bug succeeded after. BUG=chromium:645628 Change-Id: I58236222c26f90268de80dc99f22d84650e67bb7 Reviewed-on: https://chromium-review.googlesource.com/383900 Reviewed-by: Mike Frysinger <vapier@chromium.org> Tested-by: Victor Hsieh <victorhsieh@chromium.org>
* cgpt: add support for managing the legacy boot gpt bitstabilize-kevin-8785.94.BMike Frysinger2016-09-0812-14/+107
| | | | | | | | | | | | | | | | | | | | | | | Bit 2 in the GPT partition attributes has been allocated as the legacy bios boot (equivalent to the "active" or "boot" flag in MBR). If we try to boot images on newer x86 systems, syslinux dies because it can't find any GPT partition marked bootable. Update the various parts of cgpt add & show to manage this bit. Now we can run: cgpt add -i 12 -B 1 chromiumos_image.bin And the EFI partition will be marked bootable. BUG=chromium:644845 TEST=vboot_reference unittests pass TEST=booted an amd64-generic disk image via USB on a generic laptop BRANCH=None Change-Id: I78e17b8df5b0c61e9e2d8a3c703e6d5ad230fe92 Reviewed-on: https://chromium-review.googlesource.com/382411 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* cgpt: fix -A documentation to match realityMike Frysinger2016-09-082-2/+2
| | | | | | | | | | | | | | | | The documentation claims the -A option shows the raw 64-bit attributes field when in reality it only shows the high reserved 16-bits. Change the docs to match the code. BUG=chromium:644845 TEST=vboot_reference unittests pass BRANCH=None Change-Id: If163896ddbca0dc27ac8205db313031e73a68fd7 Reviewed-on: https://chromium-review.googlesource.com/382431 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
* cgpt: unify cli int parsing error checkingMike Frysinger2016-09-0810-121/+43
| | | | | | | | | | | | | | | | Most of the cmd funcs had the same logic copied & pasted multiple times over. Unify them into a common header. BUG=chromium:644845 TEST=precq passes TEST=passing invalid args to some funcs is caught BRANCH=None Change-Id: Ib7212bcbb17da1135b2508a52910aac37ee8e6cd Reviewed-on: https://chromium-review.googlesource.com/382691 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* tests: Prevent testing dev_firmware* if the keys do not exist.Hung-Te Lin2016-09-071-7/+14
| | | | | | | | | | | | | | | | | | | | In CL:378661 we removed dev_firmware* from tests/devkey but that also makes futility unit tests to fail. This changes signing test scripts to first check if dev_firmware* keys exist, and only use it (and test ZGB signing results) if available. BRANCH=none BUG=chrome-os-partner:52568,chrome-os-partner:56917 TEST=make runfutiltests; make runtests; add dev_firmware* back; run tests again and success. Change-Id: If42c8404baf183edf5c8dbeadf537efa8ad571ec Reviewed-on: https://chromium-review.googlesource.com/381151 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
* futility: use vboot2 functions for kernel preambleRandall Spangler2016-09-069-191/+194
| | | | | | | | | | | | | | | Another in a long series of refactoring changes to replace old vboot1 code with its vboot2 equivalent. Futility changes only; no change to firmware. BUG=chromium:611535 BRANCH=none TEST=make runtests Change-Id: I7be813b82820674e975db13d5e540e49bdea028d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/366057 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* vboot: Remove vboot1 host signature functionsRandall Spangler2016-09-065-191/+170
| | | | | | | | | | | | | | These have been superseded by their vboot2 equivalents. No firmware changes; host-only. BUG=chromium:611535 BRANCH=none TEST=make runtests Change-Id: I36b5d3357767f32489efb7e480049620dcc0fce4 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/363970 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* vboot: replace CreateKernelPreamble() with vboot2 equivalentRandall Spangler2016-09-068-150/+129
| | | | | | | | | | | | | Continued refactoring of host library to kernel style / vboot2 structs. BUG=chromium:611535 BRANCH=none TEST=make runtests Change-Id: Ifed376812ed7690eea1ec0dfab958e836f7724a0 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/363951 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* futility: Fix lookup of invalid algorithm namesRandall Spangler2016-09-065-34/+24
| | | | | | | | | | | | | | If given a malformed file with an invalid algorithm, futility could dereference null when looking up the algorithm names. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I26d1312b8bf2eec8d806664708676daa9f36fa58 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/380522 Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* cgpt: Fix coverity warningsRandall Spangler2016-09-062-1/+6
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I9e7ce2ba226993fc53d1745c98381cb7cfcb7712 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/380448 Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* Fix coverity warnings in firmwareRandall Spangler2016-09-066-26/+37
| | | | | | | | | | | | | | Assorted minor code issues, which we should fix so any new errors stand out more. BUG=chromium:643769 BRANCH=none TEST=make runtests Change-Id: I84182df0d0e222f4f60206c621ec62e1ee283adb Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/380697 Reviewed-by: Stefan Reinauer <reinauer@chromium.org>
* futility: Use vboot 2.0 APIs for public keysRandall Spangler2016-09-0225-253/+296
| | | | | | | | | | | | | | This replaces calls to the old vboot 1 APIs with their vboot 2.0 equivalents. BUG=chromium:611535 BRANCH=none TEST=make runtests Change-Id: Ieb1a127577c6428c47ac088c3aaa0d0dad6275a8 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/356541 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* tests: Remove dev_firmware.* keyblock and keys from devkey set.Hung-Te Lin2016-09-013-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dev_firmware* was created for legacy devices having different RW firmware - A for devmode and B for normal, like Alex and ZGB. All other Chromebooks, including the CR48, were not doing that. Signer scripts relied on checking if RW A/B are equivalent to decide if they should select <dev_firmware* for A, firmware* for B> or <firmware* (normal) for both A and B>. This worked for a long time until Skylake family joined. Skylake FSP has some limitation that we have to execute code in-place, which leads to making RW A != B (due to addresses and offsets), and triggers signer to incorrectly use dev_firmware*. The production images are using keyset folders on signerbot, which only Alex/ZGB keyset folders have dev_firmware*; so the images for Skylake boards are signed correctly. But for people running firmware related tests using tests/devkey keyset, for example platform/dev/fm_and_key_version_test_prep.sh, having dev_firmware* in devkey may produce incorrect output. There is currently no easy way for signer scripts to figure out if the image should use dev_firmware or not except looking into keyset folder. Since Alex and ZGB are pretty old and no one plans to run key change tests anymore on them, the recommended solution is to remove dev_firmware.* from devkeys folder. BRANCH=none BUG=chrome-os-partner:52568 TEST=platform/dev/fm_and_key_version_test_prep.sh -b sentry -i \ /tmp/chromiumos_test_image.bin -f 8530.69.0 -s /tmp/image.bin -v \ Google_Sentry.7820.156.0 Change-Id: Ief37dd482875efc8e808460f3ad00041b5f3b3a2 Reviewed-on: https://chromium-review.googlesource.com/378661 Commit-Ready: Hung-Te Lin <hungte@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* Remove Android signing restriction of M54+Victor Hsieh2016-08-291-9/+0
| | | | | | | | | | | | | | Effectively, this will sign Android platform apks in M53, the first ARC release. TEST=Haven't heard problem from the latest Dev release 8737.1.0 BUG=b:29915721 Change-Id: Ic71f04e7fddbe3d020c57f9933e09b5537ee7370 Reviewed-on: https://chromium-review.googlesource.com/376799 Tested-by: Victor Hsieh <victorhsieh@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
* image_signing: drop board hacking for lsb appid checksstabilize-8743.69.Bstabilize-8743.60.Bstabilize-8743.58.Bstabilize-8743.25.Brelease-R54-8743.BMike Frysinger2016-08-251-4/+2
| | | | | | | | | | | | BUG=chromium:605595 TEST=None BRANCH=None Change-Id: I8104d80d151440bdd8f419c88bd98592d9f44612 Reviewed-on: https://chromium-review.googlesource.com/371678 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org>
* Skip Android signing if executables are not foundstabilize-8737.BVictor Hsieh2016-08-231-0/+7
| | | | | | | | | | | TEST=./fm_and_key_version_test_prep ... in chroot BUG=chrome-os-partner:56279 Change-Id: I0c76aed757ae30245e07873180dbc9b609a8ec13 Reviewed-on: https://chromium-review.googlesource.com/374078 Tested-by: Victor Hsieh <victorhsieh@chromium.org> Reviewed-by: danny chan <dchan@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* tlcl: add implementations for GetOwnership and Read/WriteLockStephen Barber2016-08-213-3/+58
| | | | | | | | | | | | | | | | mount-encrypted needs to be aware of TPM ownership status, and will also want to issue a read lock for the early access NVRAM index. BRANCH=none BUG=chromium:625037 TEST=mount-encrypted shows ownership at boot with kevin Change-Id: I42f43f91d892137e1c46c7cacd88e3b749ce7f04 Reviewed-on: https://chromium-review.googlesource.com/366443 Commit-Ready: Andrey Pronin <apronin@chromium.org> Tested-by: Stephen Barber <smbarber@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* Refer keytool using relative pathVictor Hsieh2016-08-191-3/+1
| | | | | | | | | | | | | We will assume JDK bin/ is in the PATH, instead of using an absolute path. TEST=sign_official_image.sh BUG=b:29915721,chrome-os-partner:56279 Change-Id: I55379a8409b7d81f213d4d7418133691fa8152cf Reviewed-on: https://chromium-review.googlesource.com/373558 Reviewed-by: Mike Frysinger <vapier@chromium.org> Tested-by: Victor Hsieh <victorhsieh@chromium.org>
* Fix file ownership during Android apk signingVictor Hsieh2016-08-181-17/+30
| | | | | | | | | | | | | | Several files were changed to own by root instead of the original owner in the squashfs image. This has caused problem to boot Android. TEST=./sign_official_image with local keys, extract system.raw.img and override device copy. Able to launch ARC. BUG=b:29915721,b:30919855 Change-Id: Ic2595c99cbb7f7c2a2c543612a368681220cb3d9 Reviewed-on: https://chromium-review.googlesource.com/372312 Reviewed-by: Mike Frysinger <vapier@chromium.org> Tested-by: Victor Hsieh <victorhsieh@chromium.org>
* Only re-sign ARC apks when lsb-release looks legitstabilize-8714.BVictor Hsieh2016-08-161-3/+4
| | | | | | | | | | | TEST=sign_official_build.sh with veyron_minnie image # works TEST=sign_official_build.sh with veyron_shark image # skipped BUG=chromium:638289 Change-Id: Ic00b5c73fc094ad1146ffb1f29d2dcc5cfdb839d Reviewed-on: https://chromium-review.googlesource.com/371458 Tested-by: Victor Hsieh <victorhsieh@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* image_signing: avoid leaking rootfs mount in android codeMike Frysinger2016-08-161-0/+1
| | | | | | | | | | | | | | When we return early from the release check, we leaked the mount point. This could in turn cause issues with data syncing and hash calculation. BUG=b:30891460 TEST=None BRANCH=None Change-Id: I7a40007e371b8e64ca7e8210ad9121dc1a4bcf9f Reviewed-on: https://chromium-review.googlesource.com/370739 Reviewed-by: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org>
* Add script to sign Android imageVictor Hsieh2016-08-1511-0/+408
| | | | | | | | | | | | | | | | | | | | sign_android_image.sh is the main script that signs the image. It makes similar changes to an image like the Android official signing tool (sign_target_files_apks.py) does, but more Chrome OS specific. TEST=./sign_official_build.sh recovery recovery_image.bin \ ../../tests/devkeys/ out_img TEST=Same above but with a recovery image without Android image. Android signing was skipping. TEST=Same above but with a M53 image. Android signing was skipped. TEST=Unpack the image and diff the before and after. Looks correct. BUG=b:29915721 Change-Id: I0ae5f0ad8d2b05e485d60262558517ea563bf527 Reviewed-on: https://chromium-review.googlesource.com/366794 Commit-Ready: Victor Hsieh <victorhsieh@chromium.org> Tested-by: Victor Hsieh <victorhsieh@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>