Let's harden ourselves against shitty firmware which might report an
invalid PCR.
(This is not really a security issue, more a robustness issue, after all
firmware generally comes with highest privileges and trust, even though
it might just be shit)
Fixes an issue found with Claude code review
continue;
}
+ if (event->pcrIndex >= TPM2_PCRS_MAX) {
+ log_debug("Skipping event on PCR %" PRIu32 " (out of range).", event->pcrIndex);
+ continue;
+ }
+
r = event_log_add_record(el, &record);
if (r < 0)
return log_error_errno(r, "Failed to add record to event log: %m");