crossystem: Fix tpm_fwver for fwid < 12935

Prior to CL:2054270 and CL:2056343, the "fw_version_tpm_start" field in
VbSharedDataHeader (equivalently the "fw_version_tpm" field in the
latest struct) wasn't filled with the TPM firmware version. Therefore
"crossystem tpm_fwver" will always report 0 on devices with fwid <
12935, where those 2 CLs landed.

Since the TPM firmware version wasn't stored on old devices, the best we
can do is to fall back to the behavior before CL:4877902, where the
active firmware version is returned instead. This change shouldn't cause
any practical issue on existing devices, because the value of tpm_fwver
had been wrong for years until CL:4877902 fixed it.

BUG=b:269204332, b:304814996, b:306487756
TEST=emerge-geralt vboot_reference
TEST="crossystem tpm_fwver" showed 0x00010001 on octopus
BRANCH=none

Change-Id: Ibcfdbd52bbd810b1f83ffabb3d0114fbf2411d8c
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/4940487
Reviewed-by: Yi Chou <yich@google.com>
1 file changed