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

attestation-service: Fix report signature validation in SNP verifier #229

Conversation

mkulke
Copy link
Contributor

@mkulke mkulke commented Nov 21, 2023

I noticed some issues with the signature verification in the SNP verifier code:

  • openssl's ecdsa verify() will produce a bool, not a result. hence we need to consume the fn output.
  • verify() requires a sha384 (SEV-SNP ABI spec, ch10) encoded report body, not the raw bytes for a successful validation

I added test cases for both successful and failed signature verification

cc @fitzthum @larrydewey PTAL

- openssl's ecdsa verify() will produce a bool, not a result. hence we
  need to verify the result.
- the verify() requires a sha384 (SEV-SNP ABI spec, ch10) encoded
  report body, not the raw bytes
- add test cases for both successful and failed signature verification

Signed-off-by: Magnus Kulke <[email protected]>
Copy link
Member

@fitzthum fitzthum left a comment

Choose a reason for hiding this comment

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

🙏

Thanks Magnus

@fitzthum fitzthum merged commit f350942 into confidential-containers:main Nov 21, 2023
@mkulke mkulke deleted the mkulke/fix-snp-signature-verification branch November 21, 2023 15:50
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