Skip to content

Conversation

@jkl73
Copy link
Contributor

@jkl73 jkl73 commented Sep 5, 2025

Remove tcg eventlog logic in server/eventlog, use go-eventlog instead.
Update go-tdx-guest package
Add VerifyOpts.AllowEmptySBVar, which is an opt in go-eventlog Add FirmwareLogState -> MachineState conversion func and tests

@jkl73
Copy link
Contributor Author

jkl73 commented Sep 5, 2025

/gcbrun

Remove tcg eventlog logic in server/eventlog, use go-eventlog
instead.
Update go-tdx-guest package
Add VerifyOpts.AllowEmptySBVar, which is an opt in go-eventlog
Add FirmwareLogState -> MachineState conversion func and tests

Signed-off-by: Jiankun Lu <[email protected]>
@jkl73
Copy link
Contributor Author

jkl73 commented Sep 5, 2025

/gcbrun

@jkl73 jkl73 requested a review from alexmwu September 5, 2025 20:48
Copy link
Contributor

@alexmwu alexmwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create an issue to remove the conversion logic? We can either migrate to the go eventlog proto directly. For example MachineState go-eventlog's PlatformState. Or, we can embed the go-eventlog FirmwareLogState into MachineState

Digest: event.Digest,
DigestVerified: bytes.Equal(digest, event.Digest),
}
func convertToPbDatabase(cert *gepb.Database) *pb.Database {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cert should be named db or gedb

if bytes.HasPrefix(grubCmd, prefix) {
return len(prefix)
func matchWellKnownCert(cert *gepb.Certificate) (pb.WellKnownCertificate, error) {
if cert.GetWellKnown() != gepb.WellKnownCertificate_UNKNOWN {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: invert this if statement and return early to avoid nesting two conditionals

return convertToMachineState(tpmfirmwarestate)
}

func convertToMachineState(tpmfirmwarestate *gepb.FirmwareLogState) (*pb.MachineState, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider exporting this, as it is already implemented in google3

@yawangwang FYI

case gepb.GCEConfidentialTechnology_AMD_SEV_SNP:
return pb.GCEConfidentialTechnology_AMD_SEV_SNP
default:
return pb.GCEConfidentialTechnology_NONE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return an error by default

}
}

var efiState *pb.EfiState
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
}

func TestParseEventLogs(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know these are copied over to go-eventlog, but it would be good to keep these tests to ensure the output is still the same despite the conversion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants