summaryrefslogtreecommitdiff
path: root/host/lib21/host_signature.c
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib21/host_signature.c')
-rw-r--r--host/lib21/host_signature.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/host/lib21/host_signature.c b/host/lib21/host_signature.c
index 5339b075..51320e7b 100644
--- a/host/lib21/host_signature.c
+++ b/host/lib21/host_signature.c
@@ -17,9 +17,8 @@
#include "host_signature2.h"
#include "host_misc.h"
-int vb2_digest_info(enum vb2_hash_algorithm hash_alg,
- const uint8_t **buf_ptr,
- uint32_t *size_ptr)
+vb2_error_t vb2_digest_info(enum vb2_hash_algorithm hash_alg,
+ const uint8_t **buf_ptr, uint32_t *size_ptr)
{
*buf_ptr = NULL;
*size_ptr = 0;
@@ -68,11 +67,9 @@ int vb2_digest_info(enum vb2_hash_algorithm hash_alg,
}
}
-int vb21_sign_data(struct vb21_signature **sig_ptr,
- const uint8_t *data,
- uint32_t size,
- const struct vb2_private_key *key,
- const char *desc)
+vb2_error_t vb21_sign_data(struct vb21_signature **sig_ptr, const uint8_t *data,
+ uint32_t size, const struct vb2_private_key *key,
+ const char *desc)
{
struct vb21_signature s = {
.c.magic = VB21_MAGIC_SIGNATURE,
@@ -172,9 +169,9 @@ int vb21_sign_data(struct vb21_signature **sig_ptr,
return VB2_SUCCESS;
}
-int vb21_sig_size_for_key(uint32_t *size_ptr,
- const struct vb2_private_key *key,
- const char *desc)
+vb2_error_t vb21_sig_size_for_key(uint32_t *size_ptr,
+ const struct vb2_private_key *key,
+ const char *desc)
{
uint32_t size = vb2_sig_size(key->sig_alg, key->hash_alg);
@@ -188,12 +185,12 @@ int vb21_sig_size_for_key(uint32_t *size_ptr,
return VB2_SUCCESS;
}
-int vb21_sig_size_for_keys(uint32_t *size_ptr,
- const struct vb2_private_key **key_list,
- uint32_t key_count)
+vb2_error_t vb21_sig_size_for_keys(uint32_t *size_ptr,
+ const struct vb2_private_key **key_list,
+ uint32_t key_count)
{
uint32_t total = 0, size = 0;
- int rv, i;
+ vb2_error_t rv, i;
*size_ptr = 0;
@@ -208,14 +205,13 @@ int vb21_sig_size_for_keys(uint32_t *size_ptr,
return VB2_SUCCESS;
}
-int vb21_sign_object(uint8_t *buf,
- uint32_t sig_offset,
- const struct vb2_private_key *key,
- const char *desc)
+vb2_error_t vb21_sign_object(uint8_t *buf, uint32_t sig_offset,
+ const struct vb2_private_key *key,
+ const char *desc)
{
struct vb21_struct_common *c = (struct vb21_struct_common *)buf;
struct vb21_signature *sig = NULL;
- int rv;
+ vb2_error_t rv;
rv = vb21_sign_data(&sig, buf, sig_offset, key, desc);
if (rv)
@@ -232,14 +228,13 @@ int vb21_sign_object(uint8_t *buf,
return VB2_SUCCESS;
}
-int vb21_sign_object_multiple(uint8_t *buf,
- uint32_t sig_offset,
- const struct vb2_private_key **key_list,
- uint32_t key_count)
+vb2_error_t vb21_sign_object_multiple(uint8_t *buf, uint32_t sig_offset,
+ const struct vb2_private_key **key_list,
+ uint32_t key_count)
{
struct vb21_struct_common *c = (struct vb21_struct_common *)buf;
uint32_t sig_next = sig_offset;
- int rv, i;
+ vb2_error_t rv, i;
for (i = 0; i < key_count; i++) {
struct vb21_signature *sig = NULL;