Skip to content

Commit

Permalink
attestation: align SNP validator
Browse files Browse the repository at this point in the history
This aligns the code structure and error messages of the SNP validator to those of the TDX validator.
  • Loading branch information
msanft authored and Freax13 committed Aug 20, 2024
1 parent 0e5edc1 commit 2aafba5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/attestation/snp/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte

attestation := &sevsnp.Attestation{}
if err := proto.Unmarshal(attDocRaw, attestation); err != nil {
return fmt.Errorf("unmarshalling attestation: %w", err)
return fmt.Errorf("unmarshaling attestation: %w", err)
}

if attestation.Report == nil {
return fmt.Errorf("attestation missing report")
}
reportRaw, err := abi.ReportToAbiBytes(attestation.Report)
if err != nil {
return fmt.Errorf("converting report to abi: %w", err)
return fmt.Errorf("converting report to abi format: %w", err)
}
v.logger.Info("Report decoded", "reportRaw", hex.EncodeToString(reportRaw))

Expand All @@ -90,7 +90,7 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte
}
v.logger.Info("Successfully verified report signature")

// Validate the report data.
// Build the validation options.

reportDataExpected := reportdata.Construct(peerPublicKey, nonce)
v.validateOpts.ReportData = reportDataExpected[:]
Expand Down

0 comments on commit 2aafba5

Please sign in to comment.