-
Notifications
You must be signed in to change notification settings - Fork 43
Fix legacy attestation report validation #293
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
bf98692
to
d3b694f
Compare
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 looks correct to me, did you have any issues @larrydewey
Please let me know, if there is anything to address from my side. Also I would really appreciate, if you review the |
@rouming Could you squash into one commit, besides that it looks good, we can merge right after. |
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.
LGTM. Can you squash into one commit?
This commit fixes legacy attestation report verification by addressing a few problems: 1. Fix typo of `launch_digest` definition for the `LegacyAttestationReport` structure: should be `DIGEST_SIZE` not `POLICY_SIZE`. 2. Signature verification should be performed on the SHA256 digest, not on the raw data. Additionally, the return value of `sig.verify()` should be properly converted to the `Result` type. 3. The `EcdsaSignature` structure has a size of 512 bytes, but the `LegacyAttestationReport` defines the signature as 144 bytes. Change the type of the signature to an `Array<u8, 144>` with an appropriate conversion trait. Signed-off-by: Roman Penyaev <[email protected]>
@DGonzalezVillal @tylerfanelli squashed, please take a look. |
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.
LGTM
Hi folks,
For a couple of weeks, I've been investigating AMD SEV technology and experimenting with the
sev/sevctl
tool. I noticed that legacy report validation was only drafted (rewritten from the deprecatedsev-tool
) but actually does not work as expected. I've fixed that and tried to mimic the spirit of thesevctl
tool as much as possible. This is my first contribution in Rust, so your feedback is highly appreciated.What has been done in this PR:
LegacyAttestationReport
by defining it as anArray<u8, 144>
instead of anEcdsaSignature
structure, which is 512 bytes.LegacyAttestationReport
, ensuringlaunch_digest
usesDIGEST_SIZE
instead ofPOLICY_SIZE
.There should be another PR for
sevctl
itself coming soon, I'll provide a link to that PR once I push it.Update: the
sevctl
part virtee/sevctl#205