mirror of
https://github.com/google/go-attestation.git
synced 2025-02-20 17:02:47 +00:00
internal/eventlog: only trust the first time an event is written to the log (#95)
Ensure an attacker can't alter the value we interpret by appending an entry of the same type to the eventlog. Don't worry about events that come before the EV_SEPARATOR for now.
This commit is contained in:
parent
6242485b62
commit
cbf14e4244
@ -164,6 +164,12 @@ func ParseSecureBoot(events []attest.Event) (*SecureBoot, error) {
|
||||
if !sb.Enabled {
|
||||
return nil, fmt.Errorf("%s/%s present when secure boot wasn't enabled", t, data.name)
|
||||
}
|
||||
if len(sb.Authority) != 0 {
|
||||
// If a malicious value is appended to the eventlog,
|
||||
// ensure we only trust the first value written by
|
||||
// the UEFI firmware.
|
||||
return nil, fmt.Errorf("%s/%s was already present earlier in the event log", t, data.name)
|
||||
}
|
||||
sb.Authority = data.data
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user