Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

efi: Prepare to add pre-install detection #309

Merged

Conversation

chrisccoulson
Copy link
Collaborator

This changes a few types, replaces pcrProfileFlags with pcrFlags
and introduces a PCRProfileEnablePCRsOption interface which is
implemented by the existing profile options and will be implemented by
a new composite option returned by the detection code.

This changes a few types, replaces pcrProfileFlags with pcrFlags
and introduces a PCRProfileEnablePCRsOption interface which is
implemented by the existing profile options and will be implemenented by
a new composite option returned by the detection code.
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

I have a question about the reuse of the Handle type

efi/efi.go Show resolved Hide resolved
@chrisccoulson chrisccoulson requested a review from pedronis June 7, 2024 22:58
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

+1

@@ -50,7 +50,7 @@ func makeMicrosoftUEFICASecureBootNamespaceRules() *secureBootNamespaceRules {
0x13, 0xad, 0xbf, 0x43, 0x09, 0xbd, 0x82, 0x70, 0x9c, 0x8c,
0xd5, 0x4f, 0x31, 0x6e, 0xd5, 0x22, 0x98, 0x8a, 0x1b, 0xd4,
},
// pubkey alg
// pubkey a;g
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is

PCRProfileOption
PCRs() tpm2.HandleList
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: shouldn't this definition come after the PCRProfileOption one?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've moved this now

@@ -101,32 +99,32 @@ func (h *fwLoadHandler) measureSecureBootPolicyPreOS(ctx pcrBranchContext) error
events = events[1:]

switch {
case e.PCRIndex < secureBootPCR && e.EventType == tcglog.EventTypeSeparator:
case e.PCRIndex < tcglog.PCRIndex(secureBootPolicyPCR) && e.EventType == tcglog.EventTypeSeparator:
Copy link
Collaborator

Choose a reason for hiding this comment

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

would it make sense to change the type in Event?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Possibly. I think at one point I tried to implement the tcglog-parser library without a dependency on go-tpm2, with it's own types and constants for digest algorithms as well, but it's had a dependency on it for a while now so it doesn't make much sense to keep the tcglog.PCRIndex type. I'll fix that up separately.

@chrisccoulson chrisccoulson merged commit 5c01e34 into canonical:master Jun 11, 2024
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