From 0469e2478ca136c7df77a485d9390c01ca03771a Mon Sep 17 00:00:00 2001 From: Nate Sales Date: Thu, 30 Jan 2025 14:20:46 -0500 Subject: [PATCH] refactor: verify parsed report --- pkg/attestation/sev.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/attestation/sev.go b/pkg/attestation/sev.go index ad7b8a5..21ba1cc 100644 --- a/pkg/attestation/sev.go +++ b/pkg/attestation/sev.go @@ -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)