Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/attestation/azure/snp.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func (a provider) Attestation(teeNonce []byte, vTpmNonce []byte) ([]byte, error)
quote.TeeAttestation = &attest.Attestation_SevSnpAttestation{
SevSnpAttestation: snpReport,
}

return proto.Marshal(quote)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/attestation/quoteprovider/sev.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/google/go-sev-guest/verify/trust"
"github.com/google/logger"
"github.com/ultravioletrs/cocos/pkg/attestation"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
)

const (
Expand Down Expand Up @@ -199,7 +199,7 @@ func FetchAttestation(reportDataSlice []byte, vmpl uint) ([]byte, error) {
quoteProto.CertificateChain.AskCert = askPem.Bytes
quoteProto.CertificateChain.ArkCert = arkPem.Bytes

result, err := protojson.Marshal(quoteProto)
result, err := proto.Marshal(quoteProto)
if err != nil {
return []byte{}, fmt.Errorf("failed to marshal quote proto: %v", err)
}
Expand Down
5 changes: 3 additions & 2 deletions pkg/attestation/vtpm/vtpm.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,10 @@ func addTEEAttestation(attestation *attest.Attestation, nonce []byte, vmpl uint)
return fmt.Errorf("failed to fetch TEE attestation report: %v", err)
}

extReport, err := abi.ReportCertsToProto(rawTeeAttestation)
extReport := &sevsnp.Attestation{}
err = proto.Unmarshal(rawTeeAttestation, extReport)
if err != nil {
return errors.Wrap(fmt.Errorf("failed to convert TEE report to proto"), err)
return errors.Wrap(fmt.Errorf("failed to unmarshal TEE report proto"), err)
}
attestation.TeeAttestation = &attest.Attestation_SevSnpAttestation{
SevSnpAttestation: extReport,
Expand Down