2lib/2auxfw_sync: Request recovery for missing auxfw

When the hash file of auxfw is not found in the CBFS, VB2_ERROR_UNKNOWN
will be returned from vb2ex_auxfw_check(), causing the device to enter
reboot loop. Similar to how we handle missing ecrw.hash, vb2api_fail()
should be called, so that the device will try to boot from the other
slot, and if the hash is still missing, recovery will be triggered.

Call vb2api_fail() from vb2api_auxfw_sync() using the 3-argument form of
VB2_TRY(). Add a unit test to prevent regression.

BUG=b:237745301
TEST=make run2tests
TEST=emerge-corsola libpayload
BRANCH=none

Change-Id: I789c63b10201bd1852bc087199ec7b226ec85ba8
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3742863
Reviewed-by: Julius Werner <jwerner@chromium.org>
Commit-Queue: Julius Werner <jwerner@chromium.org>
2 files changed