summaryrefslogtreecommitdiff
path: root/firmware/2lib/include/2return_codes.h
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-09-30 17:52:19 -0700
committerCommit Bot <commit-bot@chromium.org>2020-01-16 03:07:34 +0000
commitac75f65b96aa886c85385fc7fff54340071b9851 (patch)
treed086c61fcc89469374ec1293844bf7ead34865d6 /firmware/2lib/include/2return_codes.h
parentb597ea7a016baa1a1416ca3f78aea2220479691c (diff)
downloadvboot-ac75f65b96aa886c85385fc7fff54340071b9851.tar.gz
2sha: Add a vb2_hash type to make it easier to work with hashes
I'm prototyping some coreboot code to closer integrate vboot with CBFS (per-file hashing and that stuff). While doing that, I noticed that it would be neat to have a standardized serializable representation for any kind of vboot hash. We already have something like that in CBFS attributes, but if we want to use it more generally it makes more sense to put it in vboot. This patch adds a suitable structure defintion to 2sha.h and two utility functions that can be used to work with it. Also add alloca() because I need it and fix the return types of vb2_..._size(), because those are just plain wrong. BRANCH=None BUG=None TEST=make runtests Change-Id: I4b535ad43704693463fb114d6a81d2b5689a87b9 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1963614 Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/2lib/include/2return_codes.h')
-rw-r--r--firmware/2lib/include/2return_codes.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index b504a087..fa6bf68a 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -110,6 +110,9 @@ enum vb2_return_code {
/* Digest size buffer too small in vb2_digest_finalize() */
VB2_ERROR_SHA_FINALIZE_DIGEST_SIZE,
+ /* Hash mismatch in vb2_hash_verify() */
+ VB2_ERROR_SHA_MISMATCH,
+
/**********************************************************************
* RSA errors
*/