-
Notifications
You must be signed in to change notification settings - Fork 17
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
efi: Prepare to add pre-install detection #309
Conversation
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.
There was a problem hiding this 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
efi/image_rules_defs.go
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo?
There was a problem hiding this comment.
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 | ||
} | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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.