summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2014-11-21 11:04:36 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-27 06:35:09 +0000
commitc644a8c0f2df024798ac0e60c6028261ed389a16 (patch)
treee9d4e91959ffd0a22025f34515b6a3996b94c863 /firmware
parentfb9a216dd677d97f3d6963f668a9b84d349ef339 (diff)
downloadvboot-c644a8c0f2df024798ac0e60c6028261ed389a16.tar.gz
vboot2: Add host library functions for signing to new struct format
Including signing with bare hashes, and signing an object with more than one signature. With unit tests, even. BUG=chromium:423882 BRANCH=none TEST=VBOOT2=1 make runtests Change-Id: Iad0b9f9f6cca7129071aebf0cbc60c0daa94d382 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/231452 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/2lib/include/2return_codes.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h
index f12f2c12..8f5a5c51 100644
--- a/firmware/2lib/include/2return_codes.h
+++ b/firmware/2lib/include/2return_codes.h
@@ -559,6 +559,47 @@ enum vb2_return_code {
VB2_ERROR_PUBLIC_KEY_HASH,
/**********************************************************************
+ * Errors generated by host library signature functions
+ */
+ VB2_ERROR_HOST_SIG = VB2_ERROR_HOST_BASE + 0x030000,
+
+ /* Bad hash algorithm in vb2_digest_info() */
+ VB2_ERROR_DIGEST_INFO,
+
+ /*
+ * Unable to determine signature size for key algorithm in
+ * vb2_sig_size_for_key().
+ */
+ VB2_ERROR_SIG_SIZE_FOR_KEY,
+
+ /* Bad signature size in vb2_sign_data() */
+ VB2_SIGN_DATA_SIG_SIZE,
+
+ /* Unable to get digest info in vb2_sign_data() */
+ VB2_SIGN_DATA_DIGEST_INFO,
+
+ /* Unable to get digest size in vb2_sign_data() */
+ VB2_SIGN_DATA_DIGEST_SIZE,
+
+ /* Unable to allocate digest buffer in vb2_sign_data() */
+ VB2_SIGN_DATA_DIGEST_ALLOC,
+
+ /* Unable to initialize digest in vb2_sign_data() */
+ VB2_SIGN_DATA_DIGEST_INIT,
+
+ /* Unable to extend digest in vb2_sign_data() */
+ VB2_SIGN_DATA_DIGEST_EXTEND,
+
+ /* Unable to finalize digest in vb2_sign_data() */
+ VB2_SIGN_DATA_DIGEST_FINALIZE,
+
+ /* RSA encrypt failed in vb2_sign_data() */
+ VB2_SIGN_DATA_RSA_ENCRYPT,
+
+ /* Not enough buffer space to hold signature in vb2_sign_object() */
+ VB2_SIGN_OBJECT_OVERFLOW,
+
+ /**********************************************************************
* Highest non-zero error generated inside vboot library. Note that
* error codes passed through vboot when it calls external APIs may
* still be outside this range.