image_signing: Verify  cr50 signing manifest compliance
image_signing: Verify  cr50 signing manifest compliance

When signing Cr50 images, Board ID flags and major version number
fields of the manifest must follow the following convention:

 - even major version numbers indicate pre-pvt branch, Board ID flag
   bit 0x10 must be set;

 - odd major version numbers indicate mp branch, Board ID flag bit
   0x10000 must be set;

BRANCH=none
BUG=b:74100307
TEST=extracted pre-pvt branch produced Cr50 tarball into /tmp/cr50.cp,
     and ran the following command:

  scripts/image_signing/sign_cr50_firmware.sh /tmp/cr50.cp tests/devkeys  \
       signed

   observed successful completion. Modified
   /tmp/cr50.cp/ec_RW-manifest-prod.json to set major version number
   to 3 instead of 4 and tried again, got the following error, as
   expected:

   sign_cr50_firmware.sh: ERROR  : Inconsistent manifest \
   /tmp/cr50.cp/ec_RW-manifest-prod.json: major = "3",  board_id_flags = "16"

Change-Id: Ic123df4396d7d497347de40a5ff448940c0b1982
Signed-off-by: Vadim Bendebury <5515d6d2d0829cbe0dd0dcf2094aaded06d58514@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1321410
Reviewed-by: David Riley <a1c52a99f156ff41f0ea478f29291144551a02f6@chromium.org>
Reviewed-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>

coreboot/vboot,coreboot/vboot,coreboot/vboot,coreboot/vboot,coreboot/vboot