mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-21 21:24:53 +00:00
tpm-eventlog: verify all algorithms, not just one of them
This will help to suss out any problems that are specific to sha1 or sha256 eventlog calculation.
This commit is contained in:
parent
fe862a1d1b
commit
9122999bfb
@ -115,19 +115,25 @@ fu_plugin_device_registered_uefi (FuPlugin *plugin, FuDevice *device)
|
|||||||
|
|
||||||
for (guint i = 0; i < checksums->len; i++) {
|
for (guint i = 0; i < checksums->len; i++) {
|
||||||
const gchar *checksum = g_ptr_array_index (checksums, i);
|
const gchar *checksum = g_ptr_array_index (checksums, i);
|
||||||
|
data->reconstructed = FALSE;
|
||||||
for (guint j = 0; j < data->pcr0s->len; j++) {
|
for (guint j = 0; j < data->pcr0s->len; j++) {
|
||||||
const gchar *checksum_tmp = g_ptr_array_index (data->pcr0s, j);
|
const gchar *checksum_tmp = g_ptr_array_index (data->pcr0s, j);
|
||||||
|
/* skip unless same algorithm */
|
||||||
|
if (strlen (checksum) != strlen (checksum_tmp))
|
||||||
|
continue;
|
||||||
if (g_strcmp0 (checksum, checksum_tmp) == 0) {
|
if (g_strcmp0 (checksum, checksum_tmp) == 0) {
|
||||||
data->reconstructed = TRUE;
|
data->reconstructed = TRUE;
|
||||||
return;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/* check at least one reconstruction for this algorithm */
|
||||||
|
if (!data->reconstructed) {
|
||||||
|
fu_device_set_update_message (device,
|
||||||
|
"TPM PCR0 differs from reconstruction, "
|
||||||
|
"please see https://github.com/fwupd/fwupd/wiki/TPM-PCR0-differs-from-reconstruction");
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* urgh, this is unexpected */
|
|
||||||
fu_device_set_update_message (device,
|
|
||||||
"TPM PCR0 differs from reconstruction, "
|
|
||||||
"please see https://github.com/fwupd/fwupd/wiki/TPM-PCR0-differs-from-reconstruction");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
Reference in New Issue
Block a user