Skip to content

Commit

Permalink
fixup! explicitly initialize struct
Browse files Browse the repository at this point in the history
  • Loading branch information
malt3 committed Oct 10, 2023
1 parent b6ca6a5 commit 7a2267c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/attestation/vtpm/attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte
// Explicitly initialize this struct, as TeeAttestation
// is a "oneof" protobuf field, which needs an explicit
// type to be set to be unmarshaled correctly.
attDoc := &AttestationDocument{
attDoc := AttestationDocument{
Attestation: &attest.Attestation{
TeeAttestation: &attest.Attestation_SevSnpAttestation{
SevSnpAttestation: &sevsnp.Attestation{},
Expand All @@ -201,7 +201,7 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte
extraData := attestation.MakeExtraData(attDoc.UserData, nonce)

// Verify and retrieve the trusted attestation public key using the provided instance info
aKP, err := v.getTrustedKey(ctx, *attDoc, extraData)
aKP, err := v.getTrustedKey(ctx, attDoc, extraData)
if err != nil {
return nil, fmt.Errorf("validating attestation public key: %w", err)
}
Expand All @@ -220,7 +220,7 @@ func (v *Validator) Validate(ctx context.Context, attDocRaw []byte, nonce []byte
}

// Validate confidential computing capabilities of the VM
if err := v.validateCVM(*attDoc, state); err != nil {
if err := v.validateCVM(attDoc, state); err != nil {
return nil, fmt.Errorf("verifying VM confidential computing capabilities: %w", err)
}

Expand Down

0 comments on commit 7a2267c

Please sign in to comment.