cr50_signing: add code to sign pre-pvt, pre-release and release

This patch adds checks necessary before various types of images
signing could proceed.

The checks include verifying that Board ID flags and major version
number match the image type.

Also, manifest modification for node locked images is enhanced by
setting the least significant bit of the tag field to one. This will
ensure that the prod key ladder is not available to node locked images
even though they are signed with a prod key.

BRANCH=none
BUG=b:74100307
TEST=verified various cases by manually editing prod.json and
     signing_instructions.sh and observing results: either error
     messages or successful modification of the manifest and signing.

Change-Id: I0bc4a8acae1ca4e983999fd47e515c48786ded6c
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1894848
1 file changed