vboot/misc: Add validity check in vb2api_enable_developer_mode

Check vb2api_allow_recovery before actual changes in
vb2api_enable_developer_mode.

Add new API error type VB2_ERROR_API_ENABLE_DEV_NOT_ALLOWED in
vb2_error_t.

Add spaces in the output message of vb2_misc_tests for indentation.

BUG=b:172339016
TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1 DETACHABLE=0; \
     make -j32 test_setup && make -j32 runtests;
TEST=export CC=x86_64-pc-linux-gnu-clang DEBUG=1 DETACHABLE=1; \
     make -j32 test_setup && make -j32 runtests;
TEST=Hayato booted into developer mode
BRANCH=none

Change-Id: Ifebdd01ca87cf944c394907eca73a09fc3bf5457
Signed-off-by: edisonhello <edisonhello@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3056240
Reviewed-by: Julius Werner <jwerner@chromium.org>
6 files changed