mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-17 13:12:43 +00:00
trivial: uefi: don't add PCRs with all 0's
I was seeing on a CML laptop with a Nuvoton TPM the following which is definitely wrong: ``` Checksum: SHA1(791183aa2c4993dfaf75e95c91bdad067ac2cce1) Checksum: SHA256(8a0656fe0024cc3300cc4dc8af4fc336112a51013aeb74b21c138ed116bb8691) Checksum: SHA1(000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) ```
This commit is contained in:
parent
cbf53fe52d
commit
069449e427
@ -161,14 +161,17 @@ fu_uefi_pcrs_setup_tpm20 (FuUefiPcrs *self, GError **error)
|
||||
|
||||
str = g_string_new (NULL);
|
||||
for (guint j = 0; j < pcr_values->digests[i].size; j++) {
|
||||
g_string_append_printf (str, "%02x", pcr_values->digests[i].buffer[j]);
|
||||
gint64 val = pcr_values->digests[i].buffer[j];
|
||||
if (val > 0)
|
||||
g_string_append_printf (str, "%02x", pcr_values->digests[i].buffer[j]);
|
||||
}
|
||||
if (str->len > 0) {
|
||||
item = g_new0 (FuUefiPcrItem, 1);
|
||||
item->idx = 0; /* constant PCR index 0, since we only read this single PCR */
|
||||
item->checksum = g_string_free (g_steal_pointer (&str), FALSE);
|
||||
g_ptr_array_add (self->items, item);
|
||||
g_debug ("added PCR-%02u=%s", item->idx, item->checksum);
|
||||
}
|
||||
|
||||
item = g_new0 (FuUefiPcrItem, 1);
|
||||
item->idx = 0; /* constant PCR index 0, since we only read this single PCR */
|
||||
item->checksum = g_string_free (g_steal_pointer (&str), FALSE);
|
||||
g_ptr_array_add (self->items, item);
|
||||
g_debug ("added PCR-%02u=%s", item->idx, item->checksum);
|
||||
}
|
||||
|
||||
/* success */
|
||||
|
Loading…
Reference in New Issue
Block a user