Skip to content

Commit

Permalink
refactor: verify parsed report
Browse files Browse the repository at this point in the history
  • Loading branch information
natesales committed Jan 30, 2025
1 parent 8a1fb9a commit 0469e24
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/attestation/sev.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ func verifySevAttestation(attestationDoc string) (*Measurement, []byte, error) {
MachineStepping: &wrapperspb.UInt32Value{Value: uint32(0)},
}

if err := verify.RawSnpReport(attDocBytes, opts); err != nil {
return nil, nil, err
}

parsedReport, err := abi.ReportToProto(attDocBytes)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse report: %v", err)
}

if err := verify.SnpReport(parsedReport, opts); err != nil {
return nil, nil, err
}

cfp, err := hex.DecodeString(string(parsedReport.ReportData))
if err != nil {
return nil, nil, fmt.Errorf("failed to decode certificate fingerprint: %v", err)
Expand Down

0 comments on commit 0469e24

Please sign in to comment.