summaryrefslogtreecommitdiff
path: root/firmware/lib20/api_kernel.c
diff options
context:
space:
mode:
authorJoel Kitching <kitching@google.com>2019-07-31 14:12:30 +0800
committerCommit Bot <commit-bot@chromium.org>2019-08-13 04:36:52 +0000
commite6700f4c70fe72850ae4f3f5df19c9281ebcefc8 (patch)
tree0f2abff7be99bc140e288058fb2eeab6f8bb8b64 /firmware/lib20/api_kernel.c
parenta5afd01feb0b4b45adbcd8ab38ab8a2ef2a2ef67 (diff)
downloadvboot-e6700f4c70fe72850ae4f3f5df19c9281ebcefc8.tar.gz
vboot: update vboot2 functions to use new vb2_error_t
To make explicit when vboot2 error codes should be returned, use the new vb2_error_t type on all functions which return VB2_ERROR_* constants. BUG=b:124141368, chromium:988410 TEST=make clean && make runtests BRANCH=none Change-Id: Idd3ee8afe8c78347783ce5fa829cb78f1e5719e2 Signed-off-by: Joel Kitching <kitching@google.com> Cq-Depend: chromium:1728113, chromium:1728499 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/1728292 Reviewed-by: Joel Kitching <kitching@chromium.org> Commit-Queue: Joel Kitching <kitching@chromium.org> Tested-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware/lib20/api_kernel.c')
-rw-r--r--firmware/lib20/api_kernel.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/firmware/lib20/api_kernel.c b/firmware/lib20/api_kernel.c
index dbe47e61..8e5f5e61 100644
--- a/firmware/lib20/api_kernel.c
+++ b/firmware/lib20/api_kernel.c
@@ -15,13 +15,13 @@
#include "2rsa.h"
#include "vb2_common.h"
-int vb2api_kernel_phase1(struct vb2_context *ctx)
+vb2_error_t vb2api_kernel_phase1(struct vb2_context *ctx)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
struct vb2_workbuf wb;
uint8_t *key_data;
uint32_t key_size;
- int rv;
+ vb2_error_t rv;
vb2_workbuf_from_ctx(ctx, &wb);
@@ -125,9 +125,9 @@ int vb2api_kernel_phase1(struct vb2_context *ctx)
return VB2_SUCCESS;
}
-int vb2api_load_kernel_vblock(struct vb2_context *ctx)
+vb2_error_t vb2api_load_kernel_vblock(struct vb2_context *ctx)
{
- int rv;
+ vb2_error_t rv;
/* Verify kernel keyblock */
rv = vb2_load_kernel_keyblock(ctx);
@@ -142,9 +142,8 @@ int vb2api_load_kernel_vblock(struct vb2_context *ctx)
return VB2_SUCCESS;
}
-int vb2api_get_kernel_size(struct vb2_context *ctx,
- uint32_t *offset_ptr,
- uint32_t *size_ptr)
+vb2_error_t vb2api_get_kernel_size(struct vb2_context *ctx,
+ uint32_t *offset_ptr, uint32_t *size_ptr)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
const struct vb2_kernel_preamble *pre;
@@ -170,9 +169,8 @@ int vb2api_get_kernel_size(struct vb2_context *ctx,
return VB2_SUCCESS;
}
-int vb2api_verify_kernel_data(struct vb2_context *ctx,
- const void *buf,
- uint32_t size)
+vb2_error_t vb2api_verify_kernel_data(struct vb2_context *ctx, const void *buf,
+ uint32_t size)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
struct vb2_kernel_preamble *pre;
@@ -183,7 +181,7 @@ int vb2api_verify_kernel_data(struct vb2_context *ctx,
uint8_t *digest;
uint32_t digest_size;
- int rv;
+ vb2_error_t rv;
vb2_workbuf_from_ctx(ctx, &wb);
@@ -250,10 +248,10 @@ int vb2api_verify_kernel_data(struct vb2_context *ctx,
return vb2_verify_digest(&key, &pre->body_signature, digest, &wb);
}
-int vb2api_kernel_phase3(struct vb2_context *ctx)
+vb2_error_t vb2api_kernel_phase3(struct vb2_context *ctx)
{
struct vb2_shared_data *sd = vb2_get_sd(ctx);
- int rv;
+ vb2_error_t rv;
/*
* If the kernel is a newer version than in secure storage, and the