Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Freax13 committed Jul 29, 2024
1 parent 58d57bc commit 2b281bd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions e2e/openssl/openssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ func TestOpenSSL(t *testing.T) {
var m manifest.Manifest
require.NoError(t, json.Unmarshal(manifestBytes, &m))

m.ReferenceValues.AKS.SNP.MinimumTCB.BootloaderVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.AKS.SNP.MinimumTCB.TEEVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.AKS.SNP.MinimumTCB.SNPVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.AKS.SNP.MinimumTCB.MicrocodeVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.BareMetalSNP.SNP.MinimumTCB.BootloaderVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.BareMetalSNP.SNP.MinimumTCB.TEEVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.BareMetalSNP.SNP.MinimumTCB.SNPVersion = toPtr(manifest.SVN(0))
m.ReferenceValues.BareMetalSNP.SNP.MinimumTCB.MicrocodeVersion = toPtr(manifest.SVN(0))

manifestBytes, err = json.Marshal(m)
require.NoError(t, err)
Expand Down
2 changes: 2 additions & 0 deletions internal/manifest/manifest.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ func (m *Manifest) RuntimeHandler(platform platforms.Platform) (string, error) {
return fmt.Sprintf("contrast-cc-%s", m.ReferenceValues.AKS.TrustedMeasurement[:32]), nil
case platforms.K3sQEMUTDX, platforms.RKE2QEMUTDX:
return fmt.Sprintf("contrast-cc-%s", m.ReferenceValues.BareMetalTDX.TrustedMeasurement[:32]), nil
case platforms.K3sQEMUSNP:
return fmt.Sprintf("contrast-cc-%s", m.ReferenceValues.BareMetalSNP.TrustedMeasurement[:32]), nil
default:
return "", fmt.Errorf("unsupported platform %s", platform)
}
Expand Down
8 changes: 8 additions & 0 deletions internal/manifest/referencevalues.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ var (
type ReferenceValues struct {
// AKS holds the reference values for AKS.
AKS *AKSReferenceValues
// BareMetalSNP holds the reference values for SNP on bare metal.
BareMetalSNP *BareMetalSNPReferenceValues
// BareMetalTDX holds the reference values for TDX on bare metal.
BareMetalTDX *BareMetalTDXReferenceValues
}
Expand All @@ -35,6 +37,12 @@ type AKSReferenceValues struct {
TrustedMeasurement HexString
}

// BareMetalSNPReferenceValues contains reference values for BareMetalSNP.
type BareMetalSNPReferenceValues struct {
SNP SNPReferenceValues
TrustedMeasurement HexString
}

// BareMetalTDXReferenceValues contains reference values for BareMetalTDX.
type BareMetalTDXReferenceValues struct {
TrustedMeasurement HexString
Expand Down

0 comments on commit 2b281bd

Please sign in to comment.