futility gscvd: add option to print out root key hash

The root public key hash needs to be incorporated into the GSC
firmware. Before this patch the only way to get the hash was to
preform an AP RO firmware signing operation, which, among other things
requires access to the platform private key.

This patch adds another invocation option where only the -r parameter
is passed in, in which case the hash of the public key is printed.

BRANCH=none
BUG=b:247653513
TEST=verified printing root pubk hash:
  $ futility  gscvd \
    -r ./nivviksSigning-MP/root_key_arv_root.vbpubk
  Root key body sha256 hash:
  b3dba1f89e943d53206e2950e06c3764fe230ef883bb8fd2932a9fb21c281ba1

Change-Id: I41d8396309d43d9d48555453d3339b0b540000c0
Signed-off-by: Vadim Bendebury <vbendeb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3906635
Auto-Submit: Vadim Bendebury <vbendeb@chromium.org>
Tested-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Vadim Bendebury <vbendeb@chromium.org>
1 file changed