-
Notifications
You must be signed in to change notification settings - Fork 83
Add certification to Seal #60
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
Conversation
|
Hi @josephlr PTAL |
josephlr
left a comment
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.
Good job on this, I have a bunch of lints, sorry.
tpm2tools/pcr.go
Outdated
| return &pl, nil | ||
| } | ||
|
|
||
| // SealCurrent represent current PCRs states. |
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.
Here and below, we need to rephrase these comments.
Idea:
// SealCurrent seals data to the specified PCR selection.
// SealTarget predicatively seals data to the specified PCR values.
// SealingOpt specifies the PCR values that should be used for Seal().
// CertifyCurrent certifies that a selection of PCRs have the same value they did when sealing the data.
// CertifyExpected certifies that the TPM had a specific set of PCR values when sealing the data.
// CertifyOpt determines which sets of PCR values pass certification in Unseal().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.
// SealCurrent seals data to the current specified PCR selection.
// SealTarget predicatively seals data to the given specified PCR values.
// SealingOpt specifies the PCR values that should be used for Seal().
// CertifyCurrent certifies that a selection of current PCRs have the same value when sealing.
// CertifyExpected certifies that the TPM had a specific set of PCR values when sealing.
// CertificationOpt determines if the given PCR value can pass certification in Unseal().
stevenrutherford
left a comment
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.
Looks like this was already reviewed pretty thoroughly. Comments are mostly nits.
|
This version will allow seal to empty PCRs selection.
|
|
Looks good. One last question: why disallow empty PCRSelections for CertifyOpt? Seems like the same story as Seal applies there: if you want to only assert which machine you are on and not that a particular machine is in a particular state, empty selections seem useful. |
We do support this (i.e. skipping certification and just unsealing) by providing a nil CertifyOpt. We then disallow empty selections as we don’t want to have/support two ways to do the same thing. I think for consistency, when sealing to an empty selection, we should use a nil SealingOpt and explicitly disallow empty selections or proto.Pcrs. That way, we can catch bugs if the programmer accidentally passes a nil selection. |
|
SealOpt now can be nil. Will panic if pass in empty selection or empty proto.Pcrs in SealOpt. I added a test for seal/reseal to nil SealOpt. |
stevenrutherford
left a comment
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.
Looks good, thanks
Changed Seal() Unseal() Reseal() APIs to accept SealingOpt and CertifyOpt.