Skip to content

Commit

Permalink
Merge pull request #23 from jrjatin/main
Browse files Browse the repository at this point in the history
Remove deprecated functions
  • Loading branch information
jrjatin authored Oct 5, 2023
2 parents 46c1339 + 530b89a commit 4ef6d6e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 65 deletions.
11 changes: 0 additions & 11 deletions validate/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,6 @@ func TdxQuote(quote *pb.QuoteV4, options *Options) error {
)
}

// RawTdxQuoteValidate checks the raw bytes representation of an attestation quote.
//
// Deprecated: Use RawTdxQuote instead. This function is no longer recommended for use.
func RawTdxQuoteValidate(raw []byte, options *Options) error {
quote, err := abi.QuoteToProto(raw)
if err != nil {
return fmt.Errorf("could not convert raw bytes to QuoteV4: %v", err)
}
return TdxQuote(quote, options)
}

// RawTdxQuote checks the raw bytes representation of an attestation quote.
func RawTdxQuote(raw []byte, options *Options) error {
quote, err := abi.QuoteToProto(raw)
Expand Down
54 changes: 0 additions & 54 deletions verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -1110,48 +1110,6 @@ func verifyEvidence(quote *pb.QuoteV4, options *Options) error {
return verifyQuote(quote, options)
}

// TdxVerify verifies the protobuf representation of an attestation quote's signature based
// on the quote's SignatureAlgo, provided the certificate chain is valid.
//
// Deprecated: Use TdxQuote instead. This function is no longer recommended for use.
func TdxVerify(quote *pb.QuoteV4, options *Options) error {
if options == nil {
return ErrOptionsNil
}

if err := abi.CheckQuoteV4(quote); err != nil {
return fmt.Errorf("QuoteV4 invalid: %v", err)
}

chain, err := extractChainFromQuote(quote)
if err != nil {
return err
}
exts, err := pcs.PckCertificateExtensions(chain.PCKCertificate)
if err != nil {
return fmt.Errorf("could not get PCK certificate extensions: %v", err)
}
var collateral *Collateral
if options.GetCollateral {

ca, err := extractCaFromPckCert(chain.PCKCertificate)
if err != nil {
return err
}
collateral, err = obtainCollateral(exts.FMSPC, ca, options)
if err != nil {
return err
}
}
options.collateral = collateral
options.pckCertExtensions = exts
options.chain = chain
if options.Now.IsZero() {
options.Now = time.Now()
}
return verifyEvidence(quote, options)
}

// TdxQuote verifies the protobuf representation of an attestation quote's signature based
// on the quote's SignatureAlgo, provided the certificate chain is valid.
func TdxQuote(quote *pb.QuoteV4, options *Options) error {
Expand Down Expand Up @@ -1192,18 +1150,6 @@ func TdxQuote(quote *pb.QuoteV4, options *Options) error {
return verifyEvidence(quote, options)
}

// RawTdxQuoteVerify verifies the raw bytes representation of an attestation quote
//
// Deprecated: Use RawTdxQuote instead. This function is no longer recommended for use.
func RawTdxQuoteVerify(raw []byte, options *Options) error {
quote, err := abi.QuoteToProto(raw)
if err != nil {
return fmt.Errorf("could not convert raw bytes to QuoteV4: %v", err)
}

return TdxQuote(quote, options)
}

// RawTdxQuote verifies the raw bytes representation of an attestation quote
func RawTdxQuote(raw []byte, options *Options) error {
quote, err := abi.QuoteToProto(raw)
Expand Down

0 comments on commit 4ef6d6e

Please sign in to comment.