diff --git a/pkg/attestation/azure/snp.go b/pkg/attestation/azure/snp.go index 2944319fc..8494303d1 100644 --- a/pkg/attestation/azure/snp.go +++ b/pkg/attestation/azure/snp.go @@ -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) } diff --git a/pkg/attestation/quoteprovider/sev.go b/pkg/attestation/quoteprovider/sev.go index d56c15654..a78c455c4 100644 --- a/pkg/attestation/quoteprovider/sev.go +++ b/pkg/attestation/quoteprovider/sev.go @@ -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 ( @@ -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) } diff --git a/pkg/attestation/vtpm/vtpm.go b/pkg/attestation/vtpm/vtpm.go index c2ac7c54a..4547f6adf 100644 --- a/pkg/attestation/vtpm/vtpm.go +++ b/pkg/attestation/vtpm/vtpm.go @@ -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,