summaryrefslogtreecommitdiff
path: root/futility/file_type_bios.c
diff options
context:
space:
mode:
Diffstat (limited to 'futility/file_type_bios.c')
-rw-r--r--futility/file_type_bios.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/futility/file_type_bios.c b/futility/file_type_bios.c
index 118b0aa3..ce6371d2 100644
--- a/futility/file_type_bios.c
+++ b/futility/file_type_bios.c
@@ -56,7 +56,6 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data)
{
GoogleBinaryBlockHeader *gbb = (GoogleBinaryBlockHeader *)buf;
struct bios_state_s *state = (struct bios_state_s *)data;
- struct vb2_packed_key *pubkey;
BmpBlockHeader *bmp;
int retval = 0;
uint32_t maxlen = 0;
@@ -96,7 +95,8 @@ int ft_show_gbb(const char *name, uint8_t *buf, uint32_t len, void *data)
printf(" HWID: %s\n", buf + gbb->hwid_offset);
print_hwid_digest(gbb, " digest: ", "\n");
- pubkey = (struct vb2_packed_key *)(buf + gbb->rootkey_offset);
+ struct vb2_packed_key *pubkey =
+ (struct vb2_packed_key *)(buf + gbb->rootkey_offset);
if (packed_key_looks_ok(pubkey, gbb->rootkey_size)) {
if (state) {
state->rootkey.offset =
@@ -282,8 +282,9 @@ static int fmap_sign_fw_preamble(const char *name, uint8_t *buf, uint32_t len,
goto whatever;
}
- RSAPublicKey *rsa = PublicKeyToRSA((VbPublicKey *)&keyblock->data_key);
- if (!rsa) {
+ if (!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;
@@ -424,13 +425,13 @@ static int sign_bios_at_end(struct bios_state_s *state)
sign_option.devkeyblock);
} else {
retval |= write_new_preamble(vblock_a, fw_a,
- sign_option.signprivate2,
+ sign_option.signprivate,
sign_option.keyblock);
}
/* FW B is always normal keys */
retval |= write_new_preamble(vblock_b, fw_b,
- sign_option.signprivate2,
+ sign_option.signprivate,
sign_option.keyblock);