diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-06-05 13:32:11 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-06-07 01:37:21 +0000 |
commit | b9be53640efdee92b1b42e60adda274563236301 (patch) | |
tree | f8f2f5ef809c7a0d163334f9e2675b016fae3ca4 /firmware/2lib/2nvstorage.c | |
parent | b64f097891e697eaf3b2794baae934f8b4d82d14 (diff) | |
download | vboot-b9be53640efdee92b1b42e60adda274563236301.tar.gz |
vboot2: Use more specific error codesstabilize-5944.Bstabilize-5943.Bstabilize-5942.Bfactory-samus-5939.B
Error codes reported by the crypto and storage APIs are now very
specific, and tests verify the proper errors are reported.
More specific error codes coming to other files next, but I don't want
this CL to get too long.
This also changes test_common.c so TEST_EQ() reports mismatched values
in both decimal and hex, and adds TEST_SUCC() to test for a successful
return value.
BUG=chromium:370082
BRANCH=none
TEST=make clean && VBOOT2=1 COV=1 make
Change-Id: I255c8e5769284fbc286b9d94631b19677a71cdd0
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/202778
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'firmware/2lib/2nvstorage.c')
-rw-r--r-- | firmware/2lib/2nvstorage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/firmware/2lib/2nvstorage.c b/firmware/2lib/2nvstorage.c index 3bfe151c..be635825 100644 --- a/firmware/2lib/2nvstorage.c +++ b/firmware/2lib/2nvstorage.c @@ -82,11 +82,11 @@ int vb2_nv_check_crc(const struct vb2_context *ctx) /* Check header */ if (VB2_NV_HEADER_SIGNATURE != (p[VB2_NV_OFFS_HEADER] & VB2_NV_HEADER_MASK)) - return VB2_ERROR_UNKNOWN; + return VB2_ERROR_NV_HEADER; /* Check CRC */ if (vb2_crc8(p, VB2_NV_OFFS_CRC) != p[VB2_NV_OFFS_CRC]) - return VB2_ERROR_UNKNOWN; + return VB2_ERROR_NV_CRC; return VB2_SUCCESS; } |