mirror of
https://github.com/ultravioletrs/cocos.git
synced 2026-06-23 04:10:25 +00:00
67f939fc66
* manager, cli and agent vtpm support * rebase and changed atls for vtpm * deleted unused code * changed chekproto.yaml script so it find the manager proto file correctly * fixe manager proto version * fix agent tests * fix server agent test * fix attestation test * fix attestation test gofumpt * created dummy RWC for TPM * fix comment * add default PCR values * rebase main * fix rust ci and missing header * changed embedded attestation to VMPL 2 * fix unused impot * fix pkg test * address attestation type * fix agent attestation test * add prc15 check * fix comments * fix cli tests * add doc * add mock for LeveledQuoteProvider when SEV-SNP device is not found Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix manager reading attestation policy * refactor PCR value checks and update attestation policy values Signed-off-by: Sammy Oina <sammyoina@gmail.com> * fix tests for sev and grpc --------- Signed-off-by: Sammy Oina <sammyoina@gmail.com> Co-authored-by: Sammy Oina <sammyoina@gmail.com>
50 lines
1.3 KiB
Go
50 lines
1.3 KiB
Go
// Copyright (c) Ultraviolet
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
//go:build embed
|
|
// +build embed
|
|
|
|
package quoteprovider
|
|
|
|
import (
|
|
"github.com/google/go-sev-guest/client"
|
|
"github.com/google/go-sev-guest/proto/sevsnp"
|
|
pb "github.com/google/go-sev-guest/proto/sevsnp"
|
|
cocosai "github.com/ultravioletrs/cocos"
|
|
)
|
|
|
|
const Nonce = 64
|
|
|
|
var _ client.LeveledQuoteProvider = (*embeddedQuoteProvider)(nil)
|
|
|
|
type embeddedQuoteProvider struct {
|
|
}
|
|
|
|
func GetLeveledQuoteProvider() (client.LeveledQuoteProvider, error) {
|
|
return &embeddedQuoteProvider{}, nil
|
|
}
|
|
|
|
// GetRawQuoteAtLevel returns the SEV quote for the given report data and VMPL.
|
|
func (e *embeddedQuoteProvider) GetRawQuoteAtLevel(reportData [64]byte, vmpl uint) ([]byte, error) {
|
|
return cocosai.EmbeddedAttestation, nil
|
|
}
|
|
|
|
// IsSupported returns true if the SEV platform is supported.
|
|
func (e *embeddedQuoteProvider) IsSupported() bool {
|
|
return true
|
|
}
|
|
|
|
// Product returns the SEV product information.
|
|
// unimplemented since it is deprecated and not used.
|
|
func (e *embeddedQuoteProvider) Product() *pb.SevProduct {
|
|
panic("unimplemented")
|
|
}
|
|
|
|
func FetchAttestation(reportDataSlice []byte) ([]byte, error) {
|
|
return cocosai.EmbeddedAttestation, nil
|
|
}
|
|
|
|
func VerifyAttestationReportTLS(attestation *sevsnp.Attestation, reportData []byte) error {
|
|
return nil
|
|
}
|