-
Notifications
You must be signed in to change notification settings - Fork 19
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
Fix check tool product behavior on hardware #92
Conversation
func DefaultProductString() string { | ||
return ProductString(abi.DefaultSevProduct()) | ||
} | ||
|
||
// ProductName returns the expected productName extension value for the product associated | ||
// with an attestation report proto. | ||
func ProductName(product *pb.SevProduct) string { |
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.
Since product.Stepping is marked as deprecated, shall we replace all its use by machine_stepping? Here and elsewhere
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 replaced all the uses, but I don't agree with the linter's blocking error here. We should have a period of time where we have both fields so we can more gradually transition.
@@ -404,6 +406,32 @@ func setString(dest *string, _, flag string, defaultValue string) { | |||
} | |||
} | |||
|
|||
func populateProduct() error { | |||
// The SevProduct can come from either product_name or the combination of product and stepping. | |||
if *testing.ProductName != "" && (*productString != "" || *stepping != "") { |
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.
Can you add some examples in the comments for ProductName/productString/stepping here? It's a bit unclear what's the difference between productname and productstring. Seems productString and stepping are flags to be parsed in. Is it the expected way to use it?
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 think that probably --stepping is redundant, but --product without the stepping is needed to not care about the expected machine stepping value. Do the descriptions on the flags not make their use clear enough?
The product and stepping values that are default may not be the same across all testing environments, so add product_name as a flag to testing library. The stepping value does not necessarily need to be checked, so deprecate the stepping field of SevProduct and replace with a UInt32Value that can be nil. The checkProductName drops checking Stepping in favor of checking the nullable MachineStepping field. Signed-off-by: Dionna Glaze <[email protected]>
The product and stepping values that are default may not be the same across all testing environments, so add product_name as a flag to testing library. The stepping value does not necessarily need to be checked, so deprecate the stepping field of SevProduct and replace with a UInt32Value that can be nil.
The checkProductName drops checking Stepping in favor of checking the nullable MachineStepping field.