mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
NOISSSUE - Fix SEV-SNP attestation policy validation (#541)
* Fix SEV-SNP attestation policy validation issue - Replace abi.ReportCertsToProto() with direct proto.Unmarshal() to bypass strict guest policy bit 17 validation that was failing - Change protojson.Marshal() to proto.Marshal() for binary protobuf output Signed-off-by: wkk <wkk@example.com> * Remove debug logging - Remove fmt.Println debug statements from cmd/agent/main.go - Remove fmt.Println debug statements from pkg/atls/certificate_provider.go - Remove fmt.Println debug statements from pkg/attestation/azure/snp.go Signed-off-by: wkk <wkk@example.com> * remove debug logs Signed-off-by: WashingtonKK <washingtonkigan@gmail.com> --------- Signed-off-by: wkk <wkk@example.com> Signed-off-by: WashingtonKK <washingtonkigan@gmail.com>
This commit is contained in:
committed by
GitHub
parent
04b0cdfd5d
commit
2b38f4595c
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user