OSDN Git Service

Support verifying the boot signature against the given pubkey.
authorTao Bao <tbao@google.com>
Wed, 19 Oct 2016 21:59:31 +0000 (14:59 -0700)
committerTao Bao <tbao@google.com>
Wed, 19 Oct 2016 22:26:38 +0000 (15:26 -0700)
commit2a75a61e2aeb241b6bd75e4d3c648f98cfc4d3be
tree0d94c7c83216bc960dd7017dab99e4656f5eb110
parent4ab6af6787d7826e8c43282b5ad78b80b172d107
Support verifying the boot signature against the given pubkey.

verify_boot_signature currently verifies the signature in the boot image
(against the certificate embedded in the image).

This CL supports additionally verifying the signature against the given
OEM pubkey (a fixed, tamper-protected key available to the bootloader).

Usage: verify_boot_signature <path-to-boot-image>
       verify_boot_signature <path-to-boot-image> <pubkey>

- Locally built boot image is signed with the default key.
$ openssl x509 -pubkey -noout -in build/target/product/security/verity.x509.pem > pubkey.pem
$ verify_boot_signature $OUT/boot.img pubkey.pem; echo $?
Signature is VALID
0

- Signed boot image should be verified with the OEM pubkey.
$ verify_boot_signature boot.img bullhead_pub.pem; echo $?
Signature is VALID
0

- Locally built boot image can be verified with its embedded certificate
  but not with the OEM pubkey. This will lead to the YELLOW boot state.
$ verify_boot_signature $OUT/boot.img; echo $?
Signature is VALID
0

$ verify_boot_signature $OUT/boot.img bullhead_pub.pem; echo $?
<...>
1

Bug: 32173582
Test: See above.

Change-Id: I11043eb796ccd128885e7412e65981cbd0183fb2
verity/verify_boot_signature.c