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

Fix check tool product behavior on hardware #92

Merged
merged 1 commit into from
Oct 19, 2023

Conversation

deeglaze
Copy link
Collaborator

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.

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 {
Copy link
Collaborator

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

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 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 != "") {
Copy link
Collaborator

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?

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 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]>
@deeglaze deeglaze merged commit 1298952 into google:main Oct 19, 2023
8 checks passed
@deeglaze deeglaze deleted the hwproduct branch February 8, 2024 16:49
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