sign_official_build.sh: Update kern_b_hash to support SHA256
sign_official_build.sh: Update kern_b_hash to support SHA256

We're updating the algorithm for this so the signing scripts have to
support it as well. Since we're running ToT signing scripts on older
images as well, determine the hash algorithm used in the image by
checking its length (40 hex digits for SHA1, 64 for SHA256).

BRANCH=None
BUG=b:137576540
TEST=$(sign_official_build.sh recovery recovery_image.bin
    /tmp/scratch/mykeys/ resigned_image.bin) -- used futility to confirm
    that new image kern_b_hash matches new image KERN-B and uses the
    expected algorithm (tried with both SHA1 and SHA256)

Cq-Depend: chromium:1706624
Change-Id: Ie1a62ad1fd4fbf141cc1c32d592b863f2d43a24e
Signed-off-by: Julius Werner <4d12f06cff3725783b352157673a720bc67c4afe@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1707529
Legacy-Commit-Queue: Commit Bot <5c2bf027dc5cc7ef186314391646e49f6866dc00@chromium.org>
Reviewed-by: Mike Frysinger <8f3f75c74bd5184edcfa6534cab3c13a00a2f794@chromium.org>

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