diff options
author | Bill Richardson <wfrichar@chromium.org> | 2015-10-15 00:23:18 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-15 19:57:13 -0700 |
commit | 02ac2885fd797fba7f12ef040f0eb041dda7af20 (patch) | |
tree | 8c8386e3fc07bb5f7cc8c5c485cf10a58dec1340 /futility/futility_options.h | |
parent | df0e1a391fa7b8d7bdb31f9623fbbcbb158cd2ad (diff) | |
download | vboot-02ac2885fd797fba7f12ef040f0eb041dda7af20.tar.gz |
futility: Revised support for RO+RW firmware
The "rwsig" type is used for independent device firmware (not
Chromebook BIOS) that need to verify themselves instead of using
software sync.
The expected use case is that a RO firmware contains a
vb2_public_key struct along with an FMAP or other pointers to a
slot for RW firmware. The RW firmware slot reserves room for a
vb2_signature struct.
This CL changes the args and behavior of the rwsig type, so that
the RW firmware can be [re]signed independently of the rest of
the image.
BUG=chrome-os-partner:46254
BRANCH=smaug,ToT
TEST=make runtests, manual
Create a keypair:
futility create --desc "Key One" tests/testkeys/key_rsa2048.pem foo
Sign a RW binary and build a complete image out of the parts:
futility sign --type rwsig --prikey foo.vbprik2 rw.bin sig.bin
dd if=/dev/zero bs=65536 count=1 of=image.bin
dd if=rw.bin of=image.bin conv=notrunc
dd if=sig.bin bs=$((65536 - 1024)) seek=1 of=image.bin conv=notrunc
Verify both the separate parts and the combined image:
futility show --type rwsig --pubkey foo.vbpubk2 rw.bin sig.bin
futility show --type rwsig --pubkey foo.vbpubk2 image.bin
Re-sign the combined image with a different keypair:
futility create --desc "Key Two" tests/testkeys/key_rsa1024.pem bar
futility sign --type rwsig --prikey bar.vbprik2 image.bin
Now the first key no longer verifies:
futility show --type rwsig --pubkey foo.vbpubk2 image.bin
But the second key does:
futility show --type rwsig --pubkey bar.vbpubk2 image.bin
Change-Id: Ifdddab08f218f506eb1dce28851b153d70140a7b
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/305980
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'futility/futility_options.h')
-rw-r--r-- | futility/futility_options.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/futility/futility_options.h b/futility/futility_options.h index e02ef2f6..3a6aecb6 100644 --- a/futility/futility_options.h +++ b/futility/futility_options.h @@ -27,6 +27,8 @@ struct show_option_s { int strict; int t_flag; enum futil_file_type type; + struct vb2_packed_key *pkey; + uint32_t sig_size; }; extern struct show_option_s show_option; @@ -53,6 +55,7 @@ struct sign_option_s { int vblockonly; char *outfile; int create_new_outfile; + int inout_file_count; char *pem_signpriv; int pem_algo_specified; uint32_t pem_algo; @@ -61,9 +64,8 @@ struct sign_option_s { enum vb2_hash_algorithm hash_alg; uint32_t ro_size, rw_size; uint32_t ro_offset, rw_offset; - uint32_t pkey_offset, sig_offset; + uint32_t data_size, sig_size; struct vb2_private_key *prikey; - struct vb2_packed_key *pkey; }; extern struct sign_option_s sign_option; |