diff options
Diffstat (limited to 'futility')
-rw-r--r-- | futility/cmd_show.c | 2 | ||||
-rw-r--r-- | futility/cmd_sign.c | 2 | ||||
-rw-r--r-- | futility/cmd_vbutil_kernel.c | 1 | ||||
-rw-r--r-- | futility/file_type_bios.c | 11 | ||||
-rw-r--r-- | futility/updater.c | 2 | ||||
-rw-r--r-- | futility/updater_archive.c | 4 | ||||
-rw-r--r-- | futility/vb1_helper.c | 2 |
7 files changed, 12 insertions, 12 deletions
diff --git a/futility/cmd_show.c b/futility/cmd_show.c index 9a2eec19..402b1330 100644 --- a/futility/cmd_show.c +++ b/futility/cmd_show.c @@ -87,7 +87,7 @@ int ft_show_pubkey(const char *name, uint8_t *buf, uint32_t len, void *data) { struct vb2_packed_key *pubkey = (struct vb2_packed_key *)buf; - if (!packed_key_looks_ok(pubkey, len)) { + if (vb2_packed_key_looks_ok(pubkey, len)) { printf("%s looks bogus\n", name); return 1; } diff --git a/futility/cmd_sign.c b/futility/cmd_sign.c index ce37e87e..109287c9 100644 --- a/futility/cmd_sign.c +++ b/futility/cmd_sign.c @@ -62,7 +62,7 @@ int ft_sign_pubkey(const char *name, uint8_t *buf, uint32_t len, void *data) struct vb2_packed_key *data_key = (struct vb2_packed_key *)buf; struct vb2_keyblock *block; - if (!packed_key_looks_ok(data_key, len)) { + if (vb2_packed_key_looks_ok(data_key, len)) { fprintf(stderr, "Public key looks bad.\n"); return 1; } diff --git a/futility/cmd_vbutil_kernel.c b/futility/cmd_vbutil_kernel.c index a0c001ac..1684c185 100644 --- a/futility/cmd_vbutil_kernel.c +++ b/futility/cmd_vbutil_kernel.c @@ -27,7 +27,6 @@ #include "kernel_blob.h" #include "vb1_helper.h" #include "vb2_common.h" -#include "vboot_common.h" /* Global opts */ static int opt_verbose; diff --git a/futility/file_type_bios.c b/futility/file_type_bios.c index 35a4f1dd..9d45269c 100644 --- a/futility/file_type_bios.c +++ b/futility/file_type_bios.c @@ -95,7 +95,7 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data) struct vb2_packed_key *pubkey = (struct vb2_packed_key *)(buf + gbb->rootkey_offset); - if (packed_key_looks_ok(pubkey, gbb->rootkey_size)) { + if (vb2_packed_key_looks_ok(pubkey, gbb->rootkey_size) == VB2_SUCCESS) { if (state) { state->rootkey.offset = state->area[BIOS_FMAP_GBB].offset + @@ -112,7 +112,8 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data) } pubkey = (struct vb2_packed_key *)(buf + gbb->recovery_key_offset); - if (packed_key_looks_ok(pubkey, gbb->recovery_key_size)) { + if (vb2_packed_key_looks_ok(pubkey, gbb->recovery_key_size) + == VB2_SUCCESS) { if (state) { state->recovery_key.offset = state->area[BIOS_FMAP_GBB].offset + @@ -264,9 +265,9 @@ static int fmap_sign_fw_preamble(const char *name, uint8_t *buf, uint32_t len, goto whatever; } - if (!packed_key_looks_ok(&keyblock->data_key, - keyblock->data_key.key_offset + - keyblock->data_key.key_size)) { + if (vb2_packed_key_looks_ok(&keyblock->data_key, + keyblock->data_key.key_offset + + keyblock->data_key.key_size)) { fprintf(stderr, "Warning: %s public key is invalid. " "Signing the entire FW FMAP region...\n", name); goto whatever; diff --git a/futility/updater.c b/futility/updater.c index 6a7d8ffa..1dc0ed50 100644 --- a/futility/updater.c +++ b/futility/updater.c @@ -666,7 +666,7 @@ static const struct vb2_packed_key *get_rootkey( struct vb2_packed_key *key = NULL; key = (struct vb2_packed_key *)((uint8_t *)gbb + gbb->rootkey_offset); - if (!packed_key_looks_ok(key, gbb->rootkey_size)) { + if (vb2_packed_key_looks_ok(key, gbb->rootkey_size)) { ERROR("Invalid root key.\n"); return NULL; } diff --git a/futility/updater_archive.c b/futility/updater_archive.c index 5d8e414d..36873a68 100644 --- a/futility/updater_archive.c +++ b/futility/updater_archive.c @@ -1035,8 +1035,8 @@ static const char *get_gbb_key_hash(const struct vb2_gbb_header *gbb, if (!gbb) return "<No GBB>"; key = (struct vb2_packed_key *)((uint8_t *)gbb + offset); - if (!packed_key_looks_ok(key, size)) - return "<Invalid key>"; + if (vb2_packed_key_looks_ok(key, size)) + return "<Invalid key>"; return packed_key_sha1_string(key); } diff --git a/futility/vb1_helper.c b/futility/vb1_helper.c index d1d7535e..74391827 100644 --- a/futility/vb1_helper.c +++ b/futility/vb1_helper.c @@ -797,7 +797,7 @@ enum futil_file_type ft_recognize_vb1_key(uint8_t *buf, uint32_t len) { /* Maybe just a packed public key? */ const struct vb2_packed_key *pubkey = (struct vb2_packed_key *)buf; - if (packed_key_looks_ok(pubkey, len)) + if (vb2_packed_key_looks_ok(pubkey, len) == VB2_SUCCESS) return FILE_TYPE_PUBKEY; /* How about a private key? */ |