summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 2kernel.c: check display request in vb2api_kernel_phase2stabilize-14989.85.Bstabilize-14989.107.Brelease-R105-14989.BHsin-Te Yuan2022-07-153-46/+15
| | | | | | | | | | | | | | | | In preparation for moving VbTryLoadKernel to depthcharge, move the VB2_NV_DISPLAY_REQUEST check from vb2api_normal_boot to vb2api_kernel_phase2. BUG=b:172339016 BRANCH=none TEST=make runtests Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I3629d8dbbcaba23220152543ba77558c8bbcdc7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3752431 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
* tests/common/boot_mode.c: Introduce SET_BOOT_MODEHsin-Te Yuan2022-07-157-94/+142
| | | | | | | | | | | | | | | | Introduce set_boot_mode to set up the corresponding ctx flags and call vb2_set_boot_mode to set ctx->boot_mode to be consistent with those flags. BUG=none BRANCH=none TEST=make runtests Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I7020639521af30bcdb6edcfac4c1a5b21ca8815e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3750959 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
* tests/common/tests.h: rename test_common.h to common/tests.hHsin-Te Yuan2022-07-1556-62/+62
| | | | | | | | | | | | | | Create tests/common/ to put some common files. BUG=none BRANCH=none TEST=make runtests Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I8918b7a1e62d47fca6074ef123e2de6f46f1aa00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3754814 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* Makefile: Hide coverage helper targets if COV is not setHsuan Ting Chen2022-07-131-5/+5
| | | | | | | | | | | | | | | | | | We only check COV=1 in `make coverage` before. This will result in deleting all files in the current working directory if we accidentally tried `make coverage_init`. Hide coverage_init and coverage_html if COV is not set. BUG=none BRANCH=none TEST=make coverage_init and see the error message TEST=make clean && COV=1 make coverage -j Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: I2d22b211b3d9e59d12faa0ab3d1c2ca8433598f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3747419 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* Makefile: coverage: Fix build failureHsuan Ting Chen2022-07-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | Currently, make coverage is broken due to two issues: 1. The optimization option -O0 ignores the inline specifier in firmware/2lib/2sha256_x86.c:46 and 52. This will violate the compile-time constraint "i" and cause a build failure. Fix this issue by using -Og instead of -O0. 2. The coverage_html requires ${COV_INFO}.* files which are generated in coverage_init and runtests. We need to add prerequisites to prevent potential errors while running with "-j". BUG=none BRANCH=none TEST=make clean && COV=1 make coverage -j Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org> Change-Id: If1f9de1dbc56f36afead9045c1f95349a5fa156c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3755927 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* 2lib/2auxfw_sync: Request recovery for missing auxfwYu-Ping Wu2022-07-132-6/+15
| | | | | | | | | | | | | | | | | | | | | | When the hash file of auxfw is not found in the CBFS, VB2_ERROR_UNKNOWN will be returned from vb2ex_auxfw_check(), causing the device to enter reboot loop. Similar to how we handle missing ecrw.hash, vb2api_fail() should be called, so that the device will try to boot from the other slot, and if the hash is still missing, recovery will be triggered. Call vb2api_fail() from vb2api_auxfw_sync() using the 3-argument form of VB2_TRY(). Add a unit test to prevent regression. BUG=b:237745301 TEST=make run2tests TEST=emerge-corsola libpayload BRANCH=none Change-Id: I789c63b10201bd1852bc087199ec7b226ec85ba8 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3742863 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* vboot_api_kernel.c: Remove kparams_ptrHsin-Te Yuan2022-07-1321-594/+490
| | | | | | | | | | | | | | | | | Pass VbSelectAndLoadKernelParams kparams as a function argument instead of using global variable kparams_ptr. Remove VbSelectAndLoadKernel and replace its tests with the unit tests for vb2_set_boot_mode, vb2api_kernel_phase2, vb2api_kernel_finalize, and vb2api_normal_boot. BUG=b:172339016 BRANCH=none TEST=make runtests Cq-Depend: chromium:3731710 Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I26895ced5e310b2894b9d42d0ad5514d3b0b930a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3731412 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* signer: Preserve capabilities on Android system imageJosh Horwich2022-07-121-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since crrev.com/c/2511121 we no longer use xattrs when using unsquashfs on the Android system image. A side-effect of this change is the loss of capabilities for a handful of Android binaries such as /system/bin/run-as. This change records the capabilities on the system image and applies them manually to the output system image. BUG=b:179170462 BRANCH=None TEST=unittests TEST=Locally sign hatch (ARC R) and kevin (ARC P) base images and verify signed base image's system.raw.img contents Signed-off-by: Josh Horwich <jhorwich@chromium.org> Change-Id: Ied824d5ebf7a5139e71341abca810b14e67623e0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3723017 Reviewed-by: Allen Webb <allenwebb@google.com> Tested-by: Josh Horwich <jhorwich@chromium.org> Reviewed-by: Prameet Shah <phshah@chromium.org> Commit-Queue: Josh Horwich <jhorwich@chromium.org> Reviewed-by: Yury Khmel <khmel@google.com> Reviewed-by: Yury Khmel <khmel@chromium.org>
* 2kernel.c: Clear VB2_NV_DIAG_REQUEST unconditionallyHsin-Te Yuan2022-07-113-10/+17
| | | | | | | | | | | | | BUG=none TEST=make runtests BRANCH=none Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I406bcf806a6bbe21faa5f069381b73d43a7550b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3737566 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Tested-by: Hsuan Ting Chen <roccochen@chromium.org>
* vb2_context: Use fixed-width type for boot_modeJulius Werner2022-07-091-2/+2
| | | | | | | | | | | | | | | | | | | | | Using enum types in serialized data structures is dangerous, because their width may depend on compiler settings. This patch changes the data type for (vb2_context).boot_mode to uint8_t to make sure the struct layout will be the same in all environments. Since we only defined boot modes up to 5 for now (and our systems are always little endian), the structure remains binary compatible with serializations of the previous version (so no struct version change should be necessary). BRANCH=none BUG=none TEST=make runtests Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I82bc8e665ea51adaaf1f5d94986c22bd62e58bba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3751833 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Subrata Banik <subratabanik@chromium.org>
* vboot: Move `vb2_fw_result` definition from 2nvstorage.h to 2api.hSubrata Banik2022-07-082-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch moves the `vb2_fw_result` enum definition from 2nvstorage.h to 2api.h as 2api.h is the only header file which is getting included by the vb2_api.h. The direction is to keep all required data structure needed by coreboot inside 2api.h only. The follow-up patch would like to implement a new API which would allow to get the slot information and vboot logic as part of coreboot will call into this API to retrieve this info prior storing into the elog while booting. BUG=b:215615970 TEST=Able to compile the Google/Kano board using the emerge command. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I35a4d34d1032dbf354b161feb6fcd68221a039a8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3737569 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Auto-Submit: Subrata Banik <subratabanik@chromium.org> Commit-Queue: Subrata Banik <subratabanik@chromium.org> Tested-by: Subrata Banik <subratabanik@chromium.org>
* OWNERS: Add roccochen@chromium.orgstabilize-14964.BYu-Ping Wu2022-07-061-0/+1
| | | | | | | | | | | | BUG=none TEST=none BRANCH=none Change-Id: Iedbad16be5f9541cb74cc092821b828bd25b12da Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3742864 Commit-Queue: Julius Werner <jwerner@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* 2api.c: Initialize display using boot_modeHsin-Te Yuan2022-07-032-14/+11
| | | | | | | | | | | | | | | | | In vb2api_fw_phase1, use the boot_mode set by vb2_set_boot_mode to determine whether to initialize display. This fixes the edge case where VB2_NV_DIAG_REQUEST is set, but vb2api_diagnostic_ui_enabled() is 0. BUG=none TEST=make runtests BRANCH=none Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: Iecb9f52b056906bcd1d7da324390672adc5112c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3737563 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* futility/file_type_bios: Rework image signingJakub Czapiga2022-06-3036-191/+725
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reworks whole BIOS image signing to support images with CBFS, and with ponly RW/A slot. CBFS images will now be truncated to eliminate unnecessary empty space, and will sign only the part of firmware area which contains the data, and not empty space. This patch also adds more checks for potential errors, and does not allow for signing incorrect nor uses data from structures, which might not be valid. futility sign command tests are also greatly extended to cover a wide variety of possible errors, which have to be handled correctly. BUG=b:197114807 TEST=sudo emerge vboot_reference TEST=build whole chromeos-bootimage after making it and coreboot use `futility sign --type bios ...` TEST=make runtests BRANCH=none Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Cq-Depend: chromium:3707104 Change-Id: I7c84aa38776e8890a87f0e9b7ec7f32d86f82c13 Disallow-Recycled-Builds: test-failures Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3575325 Tested-by: Jakub Czapiga <czapiga@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Auto-Submit: Jakub Czapiga <czapiga@google.com> Commit-Queue: Jakub Czapiga <czapiga@google.com>
* 2kernel: Add vb2api_kernel_phase2 and vb2api_normal_bootfirmware-chameleon-14947.Bfirmware-14947.BHsin-Te Yuan2022-06-285-109/+117
| | | | | | | | | | | | | | | | | | | | | Extract the middle part of VbSelectAndLoadKernel as vb2api_kernel_phase2 and call it from VbSelectAndLoadKernel. Also, remove vb2_nv_init in VbSelectAndLoadKernel. Furthermore, publicize vb2_normal_boot as vb2api_normal_boot in preparation for moving the content of VbSelectAndLoadKernel to depthcharge. Besides, when NO_BOOT is set, manual recovery should be disallowed (unless VB2_GBB_FLAG_FORCE_MANUAL_RECOVERY is set). Therefore, print the NO_BOOT debug log only for the broken screen case. BUG=b:172339016 BRANCH=none TEST=make runtests Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: I4dc5ee4fb80ecc8c24a992a489c3bf6fe267046d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3720975 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* .gitignore: ignore swap files of vimHsin-Te Yuan2022-06-271-0/+1
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=none Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: Ia29490c6fb8bf02a98ef09b1d284369802a2b750 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3719468 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Hsuan Ting Chen <roccochen@chromium.org> Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
* futility: updater: disable broken '--repack' argumentHung-Te Lin2022-06-261-1/+2
| | | | | | | | | | | | | | | | The `--repack` is actually broken if invoked from futility updater because libzip does not support SFX, and can't open an empty file. The right way to repack is to use the --repack from the wrapper script (e.g., chromeos-firmwareupdate) that it will call zip directly. BUG=b:236399204 TEST=make; test BRANCH=none Change-Id: I0a88bb9d9f16acb49029626da76e92e78fcd331d Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3721657 Reviewed-by: YH Lin <yueherngl@chromium.org>
* 2kernel: add vb2api_kernel_finalizeHsin-Te Yuan2022-06-243-13/+30
| | | | | | | | | | | | | | | Move the final part of VbSelectAndLoadKernel into vb2api_kernel_finalize and call vb2api_kernel_finalize at the end of VbSelectAndLoadKernel. BUG=b:172339016 BRANCH=none TEST=make runtests Signed-off-by: Hsin-Te Yuan <yuanhsinte@google.com> Change-Id: Ieef929f679e4703e6771313cdf34a9959cc1335f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3715882 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
* tests: Fix most of errors reported by shellcheckJakub Czapiga2022-06-2332-899/+929
| | | | | | | | | | | | BUG=none BRANCH=none TEST=make runtests Signed-off-by: Jakub Czapiga <czapiga@google.com> Change-Id: I364ac6ace35705f1cfdaec71297523d4c2132b75 Disallow-Recycled-Builds: test-failures Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3695417 Reviewed-by: Julius Werner <jwerner@chromium.org>
* scripts/image_signing: Add ensure_amd_psp_flags scriptRobert Zieba2022-06-231-0/+115
| | | | | | | | | | | | | | | | | Currently there is no script to ensure that AMD PSP flags are set correctly in a firmware image. This commit adds ensure_amd_psps_flags.sh to handle that functionality. The script can check that certain flags are set as well as checking that certain flags are not set. BRANCH=none BUG=b:202397678 TEST=Ran script with grunt, zork, MI and skyrim images, verified that it responds correctly to PSP flag values Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: Ie0864544b9b97704ee901d893b4d833c1ab068b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3526100 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* vboot_ref/Makefile: Expose symbols irregardless of USE_FLASHROMstabilize-14918.BEdward O'Callaghan2022-06-161-2/+2
| | | | | | | | | | | | | | | | | | | | subproccess helpers are only used by flashrom.c at the moment. However we temporarily need the symbols to bridge the gap with cbfstools/elogtool in upstream coreboot. Furthmore, there are new additional use-cases for subproccess in other parts of vboot_reference unrelated to flashrom directly. BUG=b:231152447 BRANCH=none TEST=builds Change-Id: Id8008eefd46efa329adf76323800bb7646bf922c Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3697856 Tested-by: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org>
* scripts/image_signing: Move `extract_firmware_bundle` to common.shRobert Zieba2022-06-152-19/+19
| | | | | | | | | | | | | | | | This commit moves `extract_firmware_bundle` into common.sh as this function is useful for other scripts as well. This commit also updates this function to use the `--unpack` option as `--sb_extract` is now deprecated. BRANCH=none BUG=b:202397678 TEST=Verified that scripts continue to work as expected Signed-off-by: Robert Zieba <robertzieba@google.com> Change-Id: Ib5596968f31a4b3b21fb81877d84b28660824818 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3665477 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* 2api: Remove UI callback functionsstabilize-quickfix-14909.132.Bstabilize-14909.100.Brelease-R104-14909.Bfirmware-guybrush-14500.Bfactory-guybrush-14908.Bfactory-brya-14909.124.BYu-Ping Wu2022-06-076-243/+34
| | | | | | | | | | | | | | | | | | | With a series of UI callback functions removed from depthcharge (see the long CL list in Cq-Depend below), now we can remove them from vboot2 API. BUG=b:172339016 TEST=make runtests -j TEST=emerge-corsola libpayload depthcharge BRANCH=none Cq-Depend: chromium:3581323, chromium:3581320, chromium:3587669 Cq-Depend: chromium:3611670, chromium:3631467, chromium:3631405 Cq-Depend: chromium:3677727, chromium:3681952 Change-Id: Icccaf81b8a6f16780bf68a6f1f3aa01689fc9ed8 Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3682754 Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
* OWNERS: Remove `*` approvalJulius Werner2022-06-031-1/+0
| | | | | | | | | | | | | | | | | | | | | | | Adding `*` to OWNERS makes Rubber Stamper not work for cherry-picks, so we transition to something else. While coreboot and depthcharge responsibilities are so distributed that it probably still makes sense to allow the whole firmware team to approve (see CL:3687245 and CL:3687246), vboot is not as platform-specific and it seems that we mostly have a tighter group of contributors. Looking at the recent commits, it seems that pretty much every patch was approved by one of the existing explicitly-mentioned owners anyway, so I think it makes sense to reduce ownership to that set. (Note that the scripts/ subdirectory already has its own additional OWNERS file managed by the infra team, so we don't necessarily need to cover that.) BRANCH=none BUG=none TEST=none Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: Ib902f4dcf654f00703da8fff831c6a2b9f7e9e0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3687195 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* futility: Remove --devsign and --devkeyblockJakub Czapiga2022-05-3016-142/+31
| | | | | | | | | | | | | | | | | | | | | This feature has not been needed since pre-2012 devices which have long since reached their end of life. We can safely remove it to simplify the code. Also remove ZGB image, as it is no longer needed. BUG=b:197114807 TEST=sudo FEATURES=test emerge vboot_reference BRANCH=none Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Cq-Depend: chromium:3650757 Change-Id: I889dc6300c5cb72bdfcb9c2b66d63e97d3f8c862 Disallow-Recycled-Builds: test-failures Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3578968 Commit-Queue: Jakub Czapiga <czapiga@google.com> Auto-Submit: Jakub Czapiga <czapiga@google.com> Tested-by: Jakub Czapiga <czapiga@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org>
* signer: Reland "Check the list of android image files"Daichi Hirono2022-05-271-0/+19
| | | | | | | | | | | | | | | | | | | | | | Previous change I5e8b4d848f30f53fae58c721c9b7ddcfbfea9852 was reverted because the check did not pass if the signing process adds new files to the image. The new check alerts only when we miss files in the original image. BUG=b:230434967 BRANCH=None TEST=Run ./sign_official_build.sh locally Signed-off-by: Daichi Hirono <hirono@chromium.org> Change-Id: If8e9eeb9568fefcde92d737b356fa84b865b05c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3653721 Commit-Queue: Shao-Chuan Lee <shaochuan@chromium.org> Tested-by: Daichi Hirono <hirono@chromium.org> Commit-Queue: Daichi Hirono <hirono@chromium.org> Auto-Submit: Daichi Hirono <hirono@chromium.org> Reviewed-by: Shao-Chuan Lee <shaochuan@chromium.org>
* futility: [deferredupdates] Defer setting firmware cookiesJae Hoon Kim2022-05-261-10/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the firmware part of go/deferredupdates. During autoupdates, it's required to defer firmware cookies (a.k.a. slot switching) to not try the updated RW firmware. Instead it is deferred for the values to be updated at a later time, when the actual update should be applied. Since there is not a clear communication method between futility and postinstall+autoupdater, it'll be the case that STATUS will be used as the IPC for postinstall+autoupdater to determine when to update firmware cookies w/ a UUID. ``` // autoupdate localhost ~ # chromeos-firmwareupdate --mode=autoupdate --wp=1 Machine Model: gimble Write Protect: HW=0 SW=0 Last Boot Version: RO=Google_Gimble.14498.0.0 ACT/B=Google_Gimble.14498.0.0 Firmware Updater: RO=Google_Gimble.14505.93.0 RW=Google_Gimble.14505.93.0 >> Starting firmware updater. >> Target image: images/bios-gimble.ro-14505-93-0.rw-14505-93-0.bin (RO:Google_Gimble.14505.93.0, RW/A:Google_Gimble.14505.93.0, RW/B:Google_Gimble.14505.93.0). >> Current system: <sys-flash> (RO:Google_Gimble.14498.0.0, RW/A:Google_Gimble.14505.93.0, RW/B:Google_Gimble.14498.0.0). >> Write protection: 1 (enabled; HW=1, SW=1). >> TRY-RW UPDATE: Updating RW_SECTION_A to try on reboot. >> DONE: Firmware updater exits successfully. fw_prev_result = trying # [RO/str] Firmware result of previous boot fw_prev_tried = B # [RO/str] Firmware tried on previous boot (A or B) fw_result = success # [RW/str] Firmware result this boot fw_tried = B # [RO/str] Firmware tried this boot (A or B) fw_try_count = 10 # [RW/int] Number of times to try fw_try_next fw_try_next = A # [RW/str] Firmware to try next (A or B) fw_vboot2 = 1 # [RO/int] 1 if firmware was selected by vboot2 or 0 otherwise fwb_tries = 10 # [RW/int] Try firmware B count fwid = Google_Gimble.14498.0.0 # [RO/str] Active firmware ID fwupdate_tries = 0 # [RW/int] Times to try OS firmware update (inside kern_nv) mainfw_act = B # [RO/str] Active main firmware // deferupdate HOLD localhost ~ # chromeos-firmwareupdate --mode=deferupdate_hold --wp=1 Machine Model: gimble Write Protect: HW=0 SW=0 Last Boot Version: RO=Google_Gimble.14498.0.0 ACT/B=Google_Gimble.14498.0.0 Firmware Updater: RO=Google_Gimble.14505.93.0 RW=Google_Gimble.14505.93.0 >> Starting firmware updater. >> Target image: images/bios-gimble.ro-14505-93-0.rw-14505-93-0.bin (RO:Google_Gimble.14505.93.0, RW/A:Google_Gimble.14505.93.0, RW/B:Google_Gimble.14505.93.0). >> Current system: <sys-flash> (RO:Google_Gimble.14498.0.0, RW/A:Google_Gimble.14505.93.0, RW/B:Google_Gimble.14498.0.0). >> Write protection: 1 (enabled; HW=1, SW=1). >> TRY-RW UPDATE: Updating RW_SECTION_A to try on reboot. >> DEFER UPDATE: Defer setting cookies for RW_SECTION_A. >> DONE: Firmware updater exits successfully. fw_prev_result = trying # [RO/str] Firmware result of previous boot fw_prev_tried = B # [RO/str] Firmware tried on previous boot (A or B) fw_result = success # [RW/str] Firmware result this boot fw_tried = B # [RO/str] Firmware tried this boot (A or B) fw_try_count = 0 # [RW/int] Number of times to try fw_try_next fw_try_next = B # [RW/str] Firmware to try next (A or B) fw_vboot2 = 1 # [RO/int] 1 if firmware was selected by vboot2 or 0 otherwise fwb_tries = 0 # [RW/int] Try firmware B count fwid = Google_Gimble.14498.0.0 # [RO/str] Active firmware ID fwupdate_tries = 0 # [RW/int] Times to try OS firmware update (inside kern_nv) mainfw_act = B # [RO/str] Active main firmware // deferupdate APPLY localhost ~ # chromeos-firmwareupdate --mode=deferupdate_apply --wp=1 Machine Model: gimble Write Protect: HW=0 SW=1 Last Boot Version: RO=Google_Gimble.14498.0.0 ACT/B=Google_Gimble.14498.0.0 Firmware Updater: RO=Google_Gimble.14505.106.0 RW=Google_Gimble.14505.106.0 >> Starting firmware updater. INFO: update_firmware: Apply defer updates, only setting cookies for the next boot slot. >> DONE: Firmware updater exits successfully. fw_prev_result = trying # [RO/str] Firmware result of previous boot fw_prev_tried = B # [RO/str] Firmware tried on previous boot (A or B) fw_result = success # [RW/str] Firmware result this boot fw_tried = B # [RO/str] Firmware tried this boot (A or B) fw_try_count = 10 # [RW/int] Number of times to try fw_try_next fw_try_next = A # [RW/str] Firmware to try next (A or B) fw_vboot2 = 1 # [RO/int] 1 if firmware was selected by vboot2 or 0 otherwise fwb_tries = 10 # [RW/int] Try firmware B count fwid = Google_Gimble.14498.0.0 # [RO/str] Active firmware ID fwupdate_tries = 0 # [RW/int] Times to try OS firmware update (inside kern_nv) mainfw_act = B # [RO/str] Active main firmware ``` BUG=b:232304971 TEST=chromeos-firmwareupdate w/ comment above BRANCH=None Signed-off-by: Jae Hoon Kim <kimjae@chromium.org> Change-Id: Idcfc5864a2cfc2b46a8b936bbab61e3da7c62596 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3661357 Commit-Queue: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Hung-Te Lin <hungte@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: gscvd: Allow passing board ID in ASCIIJulius Werner2022-05-251-3/+13
| | | | | | | | | | | | | | | | In many places (e.g. go/cros-dlm), we treat GSC board IDs as a 4-letter ASCII string rather than a hexadecimal number. To relieve people of the need to manually convert between formats when copy&pasting IDs, this patch makes the `gscvd` command accept both versions. BRANCH=none BUG=b:229015103 TEST=futility gscvd -b GVLR Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I50fa73f5a14d2747c3e1b15e5dc3fbfcb2391f47 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3656349 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* vboot: Move TPM disabling call to depthchargeYu-Ping Wu2022-05-215-23/+14
| | | | | | | | | | | | | | | | | | Introduce a new vboot context flag VB2_CONTEXT_DISABLE_TPM to indicate whether TPM should be disabled before jumping to kernel. This allows us to move the vb2ex_tpm_set_mode(VB2_TPM_MODE_DISABLED) call from vboot to depthcharge. See CL:3653659 for details. BUG=b:223662000, b:232743820 TEST=make runtests TEST=emerge-cherry depthcharge BRANCH=cherry Cq-Depend: chromium:3653659 Change-Id: Ie7bcc3c7bf01346a3bc1f9e14b30017a4c3148ac Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3653207 Reviewed-by: Julius Werner <jwerner@chromium.org>
* futility: gscvd: Add -G flag for GBB rangesJulius Werner2022-05-181-9/+111
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new `--add_gbb`/`-G` flag to the `gscvd` command that can be used as a shorthand option to add the `GBB` FMAP section to the covered ranges. When adding the GBB, it is important that we exclude the HWID and HWID digest from the covered ranges, because they can vary between units and it would be too cumbersome to sign every possible HWID separately. Figuring out the right ranges to pass that exclude these individual fields of the structure manually from the build scripts would be very awkward, so let's add this option here where we can write the logic cleanly with C code and have all the vboot data structure definitions readily available. Also do some minor option parsing cleanups. BRANCH=none BUG=b:229015103 TEST=Created GSCVDs with this flag, manually confirmed with a hex editor that the correct ranges were created. Signed-off-by: Julius Werner <jwerner@chromium.org> Change-Id: I3bef5355506d831353afe6f534ae9303334d014c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3653203 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
* Revert "signer: Check the list of android image files"Daichi Hirono2022-05-181-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 48532e571bf79f32af972f6096681c11674c3825. Reason for revert: Stable roll blocked due to unit test failures in platform/signing. https://ci.chromium.org/ui/p/chromeos/builders/cq/fullcheckout-presubmit/b8813887760837459473/overview Original change's description: > signer: Check the list of android image files > > BUG=b:230434967 > BRANCH=None > TEST=Run ./sign_official_build.sh locally > > Signed-off-by: Daichi Hirono <hirono@chromium.org> > > Change-Id: I5e8b4d848f30f53fae58c721c9b7ddcfbfea9852 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3607891 > Tested-by: Daichi Hirono <hirono@chromium.org> > Commit-Queue: Daichi Hirono <hirono@chromium.org> > Reviewed-by: Shao-Chuan Lee <shaochuan@chromium.org> Bug: b:230434967 Change-Id: I185562d6dcbac4fd30b6dc4c331bd0b1508d58e8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3644484 Commit-Queue: Daichi Hirono <hirono@chromium.org> Tested-by: Daichi Hirono <hirono@chromium.org> Reviewed-by: Shao-Chuan Lee <shaochuan@chromium.org> Auto-Submit: Daichi Hirono <hirono@chromium.org>
* futility: updater: split manifest implementation from updater_archivestabilize-14839.BHung-Te Lin2022-05-164-884/+924
| | | | | | | | | | | | | | | | | | The updater_archive has two functions: the implementation of archives, and the creation of manifest. Since we are having more support of archives in different format and the logic of manifests is getting more complicated, so it is better to move the manifest to its own file. No functional changes, only internal refactoring. BUG=None TEST=make; run test BRANCH=None Change-Id: I01ff9561583357eac4c6add8a09384f1c4c9d671 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3647407 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: support reading the archives using libarchiveHung-Te Lin2022-05-152-14/+273
| | | | | | | | | | | | | | | | | | | | The firmware archive files from buildbot are usually released in tar+bzip2 format. Although the standard format of the archive (chromeos-firmwareupdate) is ZIP, it is very helpful if the developers can quickly run the update using the standard tar.bz2 archive files. BUG=b:230679721 TEST=futility update --manifest -a \ ~/Downloads/ChromeOS-firmware-R91-13885.3.0-asurada.tar.bz2 QEMU_LD_PREFIX=/build/cherry qemu-arm /build/cherry/usr/bin/futility \ update --manifest -a \ ~/Downloads/ChromeOS-firmware-R91-13885.3.0-asurada.tar.bz2 BRANCH=None Change-Id: Ibbab2e8226a00e8b5b292293af570eda37b31a8a Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3644540 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: refactor 'archive' structure nameHung-Te Lin2022-05-155-40/+40
| | | | | | | | | | | | | | Rename 'struct archive' to 'struct u_archive' as 'updater archive' so in future we can support libarchive (which needs 'struct archive'). BUG=None TEST=make; run test BRANCH=None Change-Id: Id4e5b425044b6f1e64f504373c264dba05da62f4 Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3644539 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: Rework file opening and mappingJakub Czapiga2022-05-1414-322/+469
| | | | | | | | | | | | | | | | | | | | | | Adding calls to cbfstool truncate command requires file to be closed and not mapped to work correctly. This patch reworks file opening and mapping to make it simpler. It also moves responsibility from main command runner to command functions to correctly operate on their input/output files. BUG=b:197114807 TEST=sudo FEATURES=test emerge vboot_reference TEST=build and boot while chromeos-bootimage and boot on volteer/voxel platform BRANCH=none Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: Iee24fdc43f2a57f54c65f6e55cdd26adf44a0b29 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3575324 Tested-by: Jakub Czapiga <czapiga@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Auto-Submit: Jakub Czapiga <czapiga@google.com>
* create_new_gsc_key.sh: generate key file with the requested base namestabilize-14816.84.Bstabilize-14816.82.Bstabilize-14816.138.Bstabilize-14816.131.Bstabilize-14803.Bstabilize-14790.Brelease-R103-14816.BVadim Bendebury2022-05-061-5/+14
| | | | | | | | | | | | | | | | | | | | Let's require the user of this script to explicitly provide the base file name of the generated key. BRANCH=none BUG=b:221423468 TEST=verified generating the new key in various directories (local and non local). Verified that the script fails if the user does not supply the required key file base name. Change-Id: Iaf85e5822d06c65ca4b7d51f17579269576e4707 Signed-off-by: Vadim Bendebury <vbendeb@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3630287 Tested-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
* updater_utils: fix implicit conversion to enum wp_stateNikolai Artemiev2022-05-061-1/+1
| | | | | | | | | | | | | | | | | | The getter for HWWP implicitly converted the integer returned by crossystem to an `enum wp_state`. This only worked because of the particular values assigned to the enum values, so explicitly convert instead. BUG=b:223291615 BRANCH=none TEST=builds Change-Id: Ib572733f8b05a5a992f09ba98050a7eab5e3bcce Signed-off-by: Nikolai Artemiev <nartemiev@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3540784 Reviewed-by: Julius Werner <jwerner@chromium.org> Reviewed-by: Edward O'Callaghan <quasisec@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org>
* futility: updater: refactor creating manifest from a simple folderHung-Te Lin2022-05-051-39/+52
| | | | | | | | | | | | | | | Move the creation of simple folder manifest to a new function. No changes in functionality. BUG=None TEST=make; run test BRANCH=None Change-Id: I302752183fc4f385f9b915023d26723a5cbd0c1c Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3615697 Commit-Queue: Yu-Ping Wu <yupingso@chromium.org> Reviewed-by: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: create a manifest from the signer configHung-Te Lin2022-05-051-6/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The signer_config.csv contains almost everything we need for mapping from models to image files so that can be an alternative when models/*/setvars.sh files are not available. This can be shared by /firmware in future. Verified by comparing the manifest.json from existing firmware updaters on the following boards: volteer (share target), sarien (no ec), octopus (custom-label), and hatch (share target). for BOARD in volteer sarien octopus hatch; do /build/$BOARD/usr/sbin/chromeos-firmwareupdate --unpack test/$BOARD jq -S . <test/$BOARD/manifest.json >old rm -rf test/$BOARD/models futility update --manifest -a test/$BOARD | jq -S . >new diff new old >diff.$BOARD done # all diff.$BOARD are empty, e.g., no difference. BUG=b:230679721 TEST=make; run test BRANCH=None Change-Id: I17393c941d2577a2b1c5f00f60b25e98fa3f3a6f Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3612646 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: fix a typo in the SETVARS variable nameHung-Te Lin2022-05-051-2/+2
| | | | | | | | | | | | | | The PATH_ENDSWITH_SERVARS should be PATH_ENDSWITH_SETVARS. BUG=None TEST=make; run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: I2fd8ab9fe9accf185bc85b2a195e90a9863669bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3615696 Reviewed-by: Yu-Ping Wu <yupingso@chromium.org> Commit-Queue: Yu-Ping Wu <yupingso@chromium.org>
* futility: updater: always add a \0 when reading files from archivesstabilize-14771.Bfactory-firmware-ti50-guc-14778.Bfactory-14778.BHung-Te Lin2022-05-031-1/+5
| | | | | | | | | | | | | | | To simplify parsing text files in future we want the archive_read_file to always return a NULL terminated string on success. BUG=None TEST=make; run test BRANCH=None Signed-off-by: Hung-Te Lin <hungte@chromium.org> Change-Id: I0dd0105971a80d857a1b05d9680b34b42dbff7e6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3612645 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org>
* keygeneration: add ability to generate accessory GSC RW signing key pairVadim Bendebury2022-04-301-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GSC RW signing requires a 3070 bit RSA key. The codesigner tool when invoked expects the public key in .pem format, the same format is used by the RO codebase when incorporating the public key in the RO image. This patch introduces a new accessory key generating script, which invokes the appropriate opensssl command to generated the required key pair. BUG=b:221423468 BRANCH=none TEST=ran scripts/keygeneration/accessory/create_new_gsc_key.sh and observed two gsc keys generated: ls -l *gsc* -rw------- 1 vbendeb vbendeb 2451 Apr 21 20:42 gsc_3070.pem -rw-r--r-- 1 vbendeb vbendeb 625 Apr 21 20:42 gsc_3070.pem.pub in the FPGA setup confirmed that Ti50 RW can be signed and verified using the generated key pair. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I429c250f60aa1da28aa99f39dff40c3bcda71df6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3600151 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* futility: updater: support /firmware as a raw archiveHung-Te Lin2022-04-291-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For early bring up and the lab deployment, the developers need a simple way to update the firmware directly from the build artifacts (either from CPFE firmware archives or /build/$BOARD/firmware) before the firmware is pinned and available via chromeos-firmwareupdate. To simplify the process, we want the updater to understand the layout of files in /firmware. This change supports that as "raw archive" so developers can update by: # Verify what's available. futility update -a /build/$BOARD/firmware --manifest # Update the firmware for a specific model. futility update -a /build/$BOARD/firmware --model $MODEL # On DUT, detect the model and update the firmware. mkdir /tmp/firmware tar -xvf firmware.tbz -C /tmp/firmware futility update -a /tmp/firmware BUG=b:230679721 TEST=make; run tests BRANCH=None Change-Id: I8a262f1d2ec916da62e49a53fd45bdec9fa0ad9b Signed-off-by: Hung-Te Lin <hungte@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3611322 Reviewed-by: Sergey Frolov <sfrolov@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Julius Werner <jwerner@chromium.org>
* futility: Fix -Wstrict-prototypes warningManoj Gupta2022-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | ToT clang is complaining about missing 'void' in function prototype. futility/updater.c:1235:42: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] struct updater_config *updater_new_config() ^ void BUG=b:230345382 TEST=CQ, llvm tot test BRANCH=none Signed-off-by: Manoj Gupta <manojgupta@google.com> Change-Id: Ic68b71a7413e9396904dd319e0febce2eecb0df3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3610725 Reviewed-by: Julius Werner <jwerner@chromium.org> Commit-Queue: Julius Werner <jwerner@chromium.org> Tested-by: Manoj Gupta <manojgupta@chromium.org> Commit-Queue: Manoj Gupta <manojgupta@chromium.org> Auto-Submit: Manoj Gupta <manojgupta@chromium.org>
* signer: Check the list of android image filesDaichi Hirono2022-04-271-0/+16
| | | | | | | | | | | | | | BUG=b:230434967 BRANCH=None TEST=Run ./sign_official_build.sh locally Signed-off-by: Daichi Hirono <hirono@chromium.org> Change-Id: I5e8b4d848f30f53fae58c721c9b7ddcfbfea9852 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3607891 Tested-by: Daichi Hirono <hirono@chromium.org> Commit-Queue: Daichi Hirono <hirono@chromium.org> Reviewed-by: Shao-Chuan Lee <shaochuan@chromium.org>
* futility/file_type_bios: Remove old FlashMap area namesJakub Czapiga2022-04-2710-8094/+2
| | | | | | | | | | | | | | | | | | | | Old names are not in use for very long time, so remove them. BUG=b:197114807 TEST=cros-workon-volteer start vboot_reference && \ FW_NAME=voxel emerge-volteer vboot_reference coreboot chromeos-bootimage TEST=sudo FEATURES=test emerge vboot_reference BRANCH=none Signed-off-by: Jakub Czapiga <jacz@semihalf.com> Change-Id: I07916b82a721481c982b291e228df0772e0fc2a2 Disallow-Recycled-Builds: test-failures Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3575323 Auto-Submit: Jakub Czapiga <czapiga@google.com> Commit-Queue: Jakub Czapiga <czapiga@google.com> Reviewed-by: Julius Werner <jwerner@chromium.org> Tested-by: Jakub Czapiga <czapiga@google.com>
* Revert "keygeneration: add ability to generate GSC RW signing key pairs"Vadim Bendebury2022-04-232-34/+1
| | | | | | | | | | | | | | This reverts commit 2981c0bacbaa0446562aaa04f23e3e9f07c86069, as that patch is not the proper way to generate accessory keys. BUG=b:221423468 BRANCH=none TEST=none Change-Id: I5500424b01ef45cc353468173f60f9b202b92b54 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3600150 Reviewed-by: Mike Frysinger <vapier@chromium.org>
* keygeneration: add ability to generate GSC RW signing key pairsVadim Bendebury2022-04-202-1/+34
| | | | | | | | | | | | | | | | | | | | | | | | | GSC RW signing requires an 3070 bit RSA key. The codesigner tool when invoked expects the public key in .pem format, the same format is used by the RO codebase when incorporating the public key in the RO image. This patch introduces a new key option, RSA3070_NOSIG_ALGOID. The keys of this kind are not going to be processed by futility, hence no need to specify the signing algorithm. BUG=b:221423468 BRANCH=none TEST=ran ./create_new_keys.sh and observed two gsc keys generated: $ ls *gsc* gsc_rw_3070.pem gsc_rw_3070.pem.pub in the FPGA setup confirmed that Ti50 RW can be signed and verified using the generated key pair. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: Ie676ba8043c34900388372270329a4903656d499 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3591642 Reviewed-by: Mike Frysinger <vapier@chromium.org> Commit-Queue: Mike Frysinger <vapier@chromium.org>
* Add a pre-built keyblock for arv_platformAlyssa Haroldsen2022-04-141-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | This adds a keyblock holding the arv_platform public key that is signed with the arv_root private key. The SHA-256 of the root key is 3d74429f35be8d34bcb425d4397e2218e6961afed456a78ce30047f5b54ed158. Command to build: ./build/futility/futility vbutil_keyblock \ --pack tests/devkeys/arv_platform.keyblock \ --datapubkey tests/devkeys/arv_platform.vbpubk \ --signprivate tests/devkeys/arv_root.vbprivk BUG=b:161483233 TEST=above command BRANCH=None Signed-off-by: Alyssa Haroldsen <kupiakos@google.com> Change-Id: I7989c081e4a3ad79f957e3e6d8a3b2314e06152f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3584691 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Alyssa Haroldsen <kupiakos@google.com> Tested-by: Alyssa Haroldsen <kupiakos@google.com>
* host/lib/flashrom_drv.c: Ensure buffer is large enough in write opEdward O'Callaghan2022-04-131-0/+3
| | | | | | | | | | | | | | | BUG=b:207808292 BRANCH=none TEST=emerge-octopus and cros deploy'ed Signed-off-by: Edward O'Callaghan <quasisec@google.com> Change-Id: I8a8f941f224416d872592d6cc2de4caf058cb5bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3512274 Reviewed-by: Hung-Te Lin <hungte@chromium.org> Tested-by: Edward O'Callaghan <quasisec@chromium.org> Auto-Submit: Edward O'Callaghan <quasisec@chromium.org> Reviewed-by: Nikolai Artemiev <nartemiev@google.com> Commit-Queue: Nikolai Artemiev <nartemiev@google.com>