supports switching EC RO key

For the EC supporting EFS boot, the RO section contains a
public key, and the RW is signed. For running FAFT, should
replace the RO key to a known one (the dev key under
vboot_reference), such that FAFT tests can resign the RW
using a known private key.

For BIOS image, we use to do a similar
job to replace the key in BIOS. This CL makes the
make_dev_firmware script support changing EC key.

TEST=Modify files
$ # Check the original BIOS and EC images
$ futility show ec.bin
$ futility show bios.bin
$ ./ --change_ec -f bios.bin -t new_bios.bin \
  -e ec.bin -o new_ec.bin --backup_dir backup
$ # Check the new images, using new keys and verification succeeded
$ futility show new_ec.bin
$ futility show new_bios.bin

TEST=Modify live firmware
$ ./ --change_ec
And then run firmware_ECUpdateId with a Type-C charger.

$ recovery recovery_image.bin \
~/trunk/src/platform/vboot_reference/tests/devkeys /tmp/out.bin

TEST=make runalltests

Change-Id: Id51e2c411a4e6d016e619cec91453ce918b7fff7
Commit-Ready: Wai-Hong Tam <>
Tested-by: Wai-Hong Tam <>
Reviewed-by: Daisuke Nojiri <>
(cherry picked from commit 3585eb3d21da676db3d87e9e0490a0df92d597d2)
Commit-Queue: Daisuke Nojiri <>
Tested-by: Daisuke Nojiri <>
3 files changed