mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
COCOS-456 Remove SEV support from repo (#472)
* Remove SEV support from repo * Remove SEV references
This commit is contained in:
@@ -70,8 +70,8 @@ type Verifier interface {
|
||||
// CCPlatform returns the type of the confidential computing platform.
|
||||
func CCPlatform() PlatformType {
|
||||
checks := []ccCheck{
|
||||
{SevGuestvTPMExists, SNPvTPM},
|
||||
{SevGuesDeviceExists, SNP},
|
||||
{SevSnpGuestvTPMExists, SNPvTPM},
|
||||
{SevSnpGuestDeviceExists, SNP},
|
||||
{isAzureVM, Azure},
|
||||
{TDXGuestDeviceExists, TDX},
|
||||
}
|
||||
@@ -84,7 +84,7 @@ func CCPlatform() PlatformType {
|
||||
return NoCC
|
||||
}
|
||||
|
||||
func SevGuesDeviceExists() bool {
|
||||
func SevSnpGuestDeviceExists() bool {
|
||||
d, err := client.OpenDevice()
|
||||
if err != nil {
|
||||
return false
|
||||
@@ -94,8 +94,8 @@ func SevGuesDeviceExists() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
func SevGuestvTPMExists() bool {
|
||||
return vTPMExists() && SevGuesDeviceExists()
|
||||
func SevSnpGuestvTPMExists() bool {
|
||||
return vTPMExists() && SevSnpGuestDeviceExists()
|
||||
}
|
||||
|
||||
func vTPMExists() bool {
|
||||
|
||||
@@ -254,7 +254,7 @@ func GenerateAttestationPolicy(token, product string, policy uint64) (*attestati
|
||||
return nil, fmt.Errorf("failed to decode reportID: %w", err)
|
||||
}
|
||||
|
||||
sevProduct := quoteprovider.GetProductName(product)
|
||||
sevSnpProduct := quoteprovider.GetProductName(product)
|
||||
|
||||
return &attestation.Config{
|
||||
Config: &check.Config{
|
||||
@@ -268,7 +268,7 @@ func GenerateAttestationPolicy(token, product string, policy uint64) (*attestati
|
||||
MinimumGuestSvn: uint32(guestSVN),
|
||||
TrustedIdKeyHashes: [][]byte{idKeyDigest},
|
||||
ReportId: reportID,
|
||||
Product: &sevsnp.SevProduct{Name: sevProduct},
|
||||
Product: &sevsnp.SevProduct{Name: sevSnpProduct},
|
||||
Policy: policy,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -25,11 +25,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
cocosDirectory = ".cocos"
|
||||
caBundleName = "ask_ark.pem"
|
||||
Nonce = 64
|
||||
sevProductNameMilan = "Milan"
|
||||
sevProductNameGenoa = "Genoa"
|
||||
cocosDirectory = ".cocos"
|
||||
caBundleName = "ask_ark.pem"
|
||||
Nonce = 64
|
||||
sevSnpProductMilan = "Milan"
|
||||
sevSnpProductGenoa = "Genoa"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -38,7 +38,7 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
ErrProductLine = errors.New(fmt.Sprintf("product name must be %s or %s", sevProductNameMilan, sevProductNameGenoa))
|
||||
ErrProductLine = errors.New(fmt.Sprintf("product name must be %s or %s", sevSnpProductMilan, sevSnpProductGenoa))
|
||||
ErrAttVerification = errors.New("attestation verification failed")
|
||||
errAttValidation = errors.New("attestation validation failed")
|
||||
)
|
||||
@@ -176,9 +176,9 @@ func FetchAttestation(reportDataSlice []byte, vmpl uint) ([]byte, error) {
|
||||
|
||||
func GetProductName(product string) sevsnp.SevProduct_SevProductName {
|
||||
switch product {
|
||||
case sevProductNameMilan:
|
||||
case sevSnpProductMilan:
|
||||
return sevsnp.SevProduct_SEV_PRODUCT_MILAN
|
||||
case sevProductNameGenoa:
|
||||
case sevSnpProductGenoa:
|
||||
return sevsnp.SevProduct_SEV_PRODUCT_GENOA
|
||||
default:
|
||||
return sevsnp.SevProduct_SEV_PRODUCT_UNKNOWN
|
||||
|
||||
@@ -20,7 +20,7 @@ import (
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
const sevProductNameMilan = "Milan"
|
||||
const sevSnpProductMilan = "Milan"
|
||||
|
||||
var policy = attestation.Config{Config: &check.Config{Policy: &check.Policy{}, RootOfTrust: &check.RootOfTrust{}}, PcrConfig: &attestation.PcrConfig{}}
|
||||
|
||||
@@ -192,7 +192,7 @@ func setAttestationPolicy(rr *sevsnp.Attestation, policyDirectory string) error
|
||||
policy.Config.Policy.Measurement = rr.Report.Measurement
|
||||
policy.Config.Policy.HostData = rr.Report.HostData
|
||||
policy.Config.Policy.ReportIdMa = rr.Report.ReportIdMa
|
||||
policy.Config.RootOfTrust.ProductLine = sevProductNameMilan
|
||||
policy.Config.RootOfTrust.ProductLine = sevSnpProductMilan
|
||||
|
||||
policyByte, err := ConvertPolicyToJSON(&policy)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user