Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attestation: use KDS as fallback if THIM retrieval fails #390

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions internal/attestation/snp/issuer.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,16 @@ func (i *Issuer) Issue(_ context.Context, ownPublicKey []byte, nonce []byte) (re
i.logger.Info("Retrieved report", "reportRaw", hex.EncodeToString(reportRaw))

// Get cert chain from THIM
var certChain *spb.CertificateChain
thimRaw, err := i.thimGetter.GetCertification()
if err != nil {
return nil, fmt.Errorf("issuer: getting cert chain from THIM: %w", err)
}
i.logger.Info("Retrieved THIM certification", "thim", thimRaw)
certChain, err := thimRaw.Proto()
if err != nil {
return nil, fmt.Errorf("issuer: converting THIM cert chain: %w", err)
i.logger.Info("Could not retrieve THIM certification", "error", err)
} else {
i.logger.Info("Retrieved THIM certification", "thim", thimRaw)
certChain, err = thimRaw.Proto()
if err != nil {
return nil, fmt.Errorf("issuer: converting THIM cert chain: %w", err)
}
}

// Get SNP product info from cpuid
Expand Down