summaryrefslogtreecommitdiff
path: root/firmware/2lib/2nvstorage.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-06-05 13:32:11 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-06-07 01:37:21 +0000
commitb9be53640efdee92b1b42e60adda274563236301 (patch)
treef8f2f5ef809c7a0d163334f9e2675b016fae3ca4 /firmware/2lib/2nvstorage.c
parentb64f097891e697eaf3b2794baae934f8b4d82d14 (diff)
downloadvboot-b9be53640efdee92b1b42e60adda274563236301.tar.gz
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.c4
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;
}