0
0
Fork
You've already forked vboot
0
No description
  • C 78.1%
  • Shell 18.4%
  • Makefile 1.7%
  • Python 1.1%
  • C++ 0.3%
  • Other 0.3%
Nicholas Bishop a5f6ef5e32 sign_uefi: Use the v2 crdyshim key for signing crdyboot
Note that this will have no immediate effect on the reven board because
the `crdyboot_presigned` USE flag is set, so these signing operations
are skipped for now.
BRANCH=None
BUG=b:421963848
TEST=make runtests
TEST=create image with dev version of crdyshim
TEST=crdyshim must include the changes from chromium:7416135
TEST=scripts/image_signing/sign_official_build.sh recovery \
TEST= disk.unsigned tests/devkeys disk.signed
TEST=boot, verify crdyshim successfully verifies the signature
Change-Id: I93af7f6edf44e09a8394353af344a48e6d5a038d
Signed-off-by: Nicholas Bishop <nicholasbishop@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/7427950
Reviewed-by: Benjamin Shai <bshai@google.com>
2026年01月13日 17:02:36 -08:00
cgpt cgptlib: Allow to boot from Android vbmeta 2025年04月03日 07:21:32 -07:00
firmware vb2_sha: Use uint64_t for total size in SHA-2 2026年01月12日 00:51:20 -08:00
futility futility: Support model detection by Android property ro.product.name 2026年01月13日 02:40:42 -08:00
host Fix OpenSSL memory leaks and incorrect free() usage 2025年12月23日 05:31:20 -08:00
rust Update Rust OWNERS file to include libchromeos-rs/OWNERS 2024年10月21日 16:58:13 +00:00
scripts sign_uefi: Use the v2 crdyshim key for signing crdyboot 2026年01月13日 17:02:36 -08:00
tests test: fix problem with load android test cases 2026年01月05日 06:39:09 -08:00
utility Fix OpenSSL memory leaks and incorrect free() usage 2025年12月23日 05:31:20 -08:00
.checkpatch.conf checkpatch: Change max line length from 80 to 96 2023年07月11日 09:51:56 +00:00
.clang-format .clang-format: Change the ColumnLimit from 80 to 96 2023年06月21日 07:49:44 +00:00
.gitignore Port sign_uefi.sh to Python 2022年12月15日 10:22:41 +00:00
Android.bp Android.bp: allow libvboot_host to be built as a shared library 2026年01月01日 20:13:34 -08:00
DIR_METADATA DIR_METADATA: Add V2 Test Plans. 2022年09月30日 15:39:12 +00:00
emerge_test.sh treewide: Fix copyrights and extra new lines at end of file 2022年10月21日 16:17:47 +00:00
LICENSE Add LICENSE file 2010年08月05日 14:18:38 -07:00
Makefile tests: add test cases to boot android kernel 2025年12月30日 02:25:01 -08:00
OWNERS OWNERS: Add bernacki 2025年07月29日 02:55:34 -07:00
PRESUBMIT.cfg scripts/image_signing/swap_ecrw: Support ecrw.version 2024年05月07日 03:14:58 +00:00
PRESUBMIT.py PRESUBMIT: switch to cros format 2023年10月30日 06:13:16 +00:00
README README: Add 'futility sign' and 'futility verify' to useful utilities 2024年01月26日 06:33:03 +00:00
unblocked_terms.txt PRESUBMIT: switch to cros format 2023年10月30日 06:13:16 +00:00
vboot.rc vboot.rc: Fix TMPFS mounting and unmounting 2025年04月03日 05:02:07 -07:00
vboot_host.pc.in vboot_host: Expose dynamic library 2024年02月09日 01:18:50 +00:00

This directory contains a reference implementation for Chrome OS
verified boot in firmware.
----------
Directory Structure
----------
The source is organized into distinct modules -
firmware/
 Contains ONLY the code required by the BIOS to validate the secure boot
 components. There shouldn't be any code in here that signs or generates
 images. BIOS should require ONLY this directory to implement secure boot.
 Refer to firmware/README for futher details.
cgpt/
 Utility to read/write/modify GPT partitions. Similar to GNU parted or any
 other GPT tool, but this has support for Chrome OS extensions.
host/
 Miscellaneous functions needed by userland utilities.
futility/
 The "firmware utility" tool, used to create, sign, and validate Chrome OS
 images.
utility/
 Random other utilities, not necesssarily related to verified boot as such.
tests/
 User-land tests and benchmarks that test the reference implementation.
 Please have a look at these if you'd like to understand how to use the
 reference implementation.
build/
 The output directory where the generated files will be placed, and where
 tests are run.
scripts/
 Tools and scripts used to generate and use new signing keypairs. These are
 typically used only on a secure machine.
rust/
 Rust bindings for vboot_reference. See rust/README.md for more details.
--------------------
Building and testing
--------------------
The suite can be built on the host or in the chroot environment.
Building on the host could fail if certain packages are not installed. If
there are host environment build problems due to missing .h files, try
researching what packages the files belong to and install the missing packages
before reporting a problem.
The commands are the more-or-less expected ones:
 make
 make runtests
 make install [ DESTDIR=/usr/local ]
----------
Some useful utilities:
----------
futility vbutil_key Convert a public key into .vbpubk format
futility vbutil_keyblock Wrap a public key inside a signature and checksum
futility sign Sign a blob. Supported operations include:
 * Create a .vblock with signature info for a
 firmware image
 * Re-sign a firmware image
 * Pack a vmlinuz image, bootloader and config into a
 kernel partition
futility verify Verify a blob such as a firmware image or a kernel
 partition
dumpRSAPublicKey Dump RSA Public key (from a DER-encoded X509
 certificate) in a format suitable for use by
 RSAVerify* functions in crypto/.
----------
Generating a signed firmware image:
----------
* Step 0: Build the tools, install them somewhere.
* Step 1: Generate RSA root and signing keys.
 The root key is always 8192 bits.
 $ openssl genrsa -F4 -out root_key.pem 8192
 The signing key can be between 1024-8192 bits.
 $ openssl genrsa -F4 -out signing_key.pem <1024|2048|4096|8192>
 Note: The -F4 option must be specified to generate RSA keys with a public
 exponent of 65535. RSA keys with 3 as a public exponent (the default)
 won't work.
* Step 2: Generate pre-processed public versions of the above keys using
 dumpRSAPublicKey. This utility expects an x509 certificate as
 input, and emits an intermediate representation for further
 processing.
 $ openssl req -batch -new -x509 -key root_key.pem -out root_key.crt
 $ openssl req -batch -new -x509 -key signing_key.pem -out signing_key.crt
 $ dumpRSAPublicKey root_key.crt > root_key.keyb
 $ dumpRSAPublicKey signing_key.crt > signing_key.keyb
************** TODO: STUFF PAST HERE IS OUT OF DATE ***************
At this point we have all the requisite keys needed to generate a signed
firmware image.
.pem RSA Public/Private Key Pair
.crt X509 Key Certificate
.keyb Pre-processed RSA Public Key
* Step 3: Use utility/firmware_utility to generate a signed firmare blob.
$ utility/firmware_utility --generate \
 --root_key root_key.pem \
 --firmware_sign_key signing_key.pem \
 --firmware_sign_key_pub signing_key.keyb \
 --firmware_sign_algorithm <algoid> \
 --firmware_key_version 1 \
 --firmware_version 1 \
 --in <firmware blob file> \
 --out <output file>
Where <algoid> is based on the signature algorithm to use for firmware
signining. The list of <algoid> specifications can be output by running
'utility/firmware_utility' without any arguments.
Note: --firmware_key_version and --firmware_version are part of a signed
 image and are used to prevent rollbacks to older version. For testing,
 they can just be set to valid values.
* Step 4: Verify that this image verifies.
$ utility/firmware_utility --verify \
 --in <signed firmware image>
 --root_key_pub root_key.keyb
Verification SUCCESS.
Note: The verification functions expects a pointer to the
 pre-processed public root key as input. For testing purposes,
 root_key.keyb can be stored in RW part of the firmware. For the
 final firmware, this will be a fixed public key which cannot be
 changed and must be stored in RO firmware.
----------
Generating a signed kernel image:
----------
The steps for generating a signed kernel image are similar to that of
a firmware image. Since verification is chained - RO firmware verifies
RW firmware which verifies the kernel, only the keys change. An additional
kernel signing key must be generated. The firmware signing generated above
is the root key equivalent for signed kernel images.