Debian Codegraph @

client/eventlog.go

raw
1 package client
2
3 import "io"
4
5 // GetEventLog grabs the crypto-agile TCG event log for the system. The TPM can
6 // override this implementation by implementing EventLogGetter.
7 func GetEventLog(rw io.ReadWriter) ([]byte, error) {
8 if elg, ok := rw.(EventLogGetter); ok {
9 return elg.EventLog()
10 }
11 return getRealEventLog()
12 }
13
14 // EventLogGetter allows a TPM (io.ReadWriter) to specify a particular
15 // implementation for GetEventLog(). This is useful for testing and necessary
16 // for Windows Event Log support (which requires a handle to the TPM).
17 type EventLogGetter interface {
18 EventLog() ([]byte, error)
19 }