Skip to content

Commit baf750b

Browse files
Remove verifyCS experiment usage (google#728)
1 parent cb37f17 commit baf750b

File tree

4 files changed

+14
-30
lines changed

4 files changed

+14
-30
lines changed

launcher/agent/agent.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -398,10 +398,7 @@ func (a *agent) attestDeviceROTs(nonce []byte, opts AttestAgentOpts) ([]*attesta
398398
}
399399

400400
func (a *agent) verify(ctx context.Context, req verifier.VerifyAttestationRequest, client verifier.Client) (*verifier.VerifyAttestationResponse, error) {
401-
if a.launchSpec.Experiments.EnableVerifyCS {
402-
return client.VerifyConfidentialSpace(ctx, req)
403-
}
404-
return client.VerifyAttestation(ctx, req)
401+
return client.VerifyConfidentialSpace(ctx, req)
405402
}
406403

407404
func convertOCIToContainerSignature(ociSig oci.Signature) (*verifier.ContainerSignature, error) {

launcher/agent/agent_test.go

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -993,16 +993,15 @@ func TestAttestationEvidence_TPM_Success(t *testing.T) {
993993
}
994994

995995
type testClient struct {
996-
verifyCSResp *verifier.VerifyAttestationResponse
997-
verifyAttResp *verifier.VerifyAttestationResponse
996+
verifyCSResp *verifier.VerifyAttestationResponse
998997
}
999998

1000999
func (t *testClient) CreateChallenge(_ context.Context) (*verifier.Challenge, error) {
10011000
return nil, errors.New("unimplemented")
10021001
}
10031002

10041003
func (t *testClient) VerifyAttestation(_ context.Context, _ verifier.VerifyAttestationRequest) (*verifier.VerifyAttestationResponse, error) {
1005-
return t.verifyAttResp, nil
1004+
return nil, errors.New("Should not be called - use VerifyConfidentialSpace")
10061005
}
10071006

10081007
func (t *testClient) VerifyConfidentialSpace(_ context.Context, _ verifier.VerifyAttestationRequest) (*verifier.VerifyAttestationResponse, error) {
@@ -1013,45 +1012,28 @@ func TestVerify(t *testing.T) {
10131012
expectedCSResp := &verifier.VerifyAttestationResponse{
10141013
ClaimsToken: []byte("verify-cs-token"),
10151014
}
1016-
expectedAttResp := &verifier.VerifyAttestationResponse{
1017-
ClaimsToken: []byte("verify-att-token"),
1018-
}
10191015

10201016
vClient := &testClient{
1021-
verifyCSResp: expectedCSResp,
1022-
verifyAttResp: expectedAttResp,
1017+
verifyCSResp: expectedCSResp,
10231018
}
10241019

10251020
testcases := []struct {
10261021
name string
10271022
opts AttestAgentOpts
1028-
exps experiments.Experiments
10291023
expectedResp *verifier.VerifyAttestationResponse
10301024
}{
10311025
{
1032-
name: "VerifyCS in experiment",
1033-
exps: experiments.Experiments{
1034-
EnableVerifyCS: true,
1035-
},
1026+
name: "Verify calls VerifyConfidentialSpace",
10361027
expectedResp: expectedCSResp,
10371028
},
1038-
{
1039-
name: "VerifyAtt in experiment",
1040-
exps: experiments.Experiments{
1041-
EnableVerifyCS: false,
1042-
},
1043-
expectedResp: expectedAttResp,
1044-
},
10451029
}
10461030

10471031
ctx := context.Background()
10481032

10491033
for _, tc := range testcases {
10501034
t.Run(tc.name, func(t *testing.T) {
10511035
attAgent := agent{
1052-
launchSpec: spec.LaunchSpec{
1053-
Experiments: tc.exps,
1054-
},
1036+
launchSpec: spec.LaunchSpec{},
10551037
}
10561038

10571039
resp, err := attAgent.verify(ctx, verifier.VerifyAttestationRequest{}, vClient)

launcher/internal/experiments/experiments.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ type Experiments struct {
1414
EnableTestFeatureForImage bool
1515
EnableHealthMonitoring bool
1616
EnableItaVerifier bool
17-
EnableVerifyCS bool
1817
EnableAttestationEvidence bool
1918
EnableB200DriverInstallation bool
2019
EnableH100DriverInstallation bool

launcher/internal/experiments/experiments_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ func TestExperiments(t *testing.T) {
3131
},
3232
},
3333
{
34-
input: "{\"EnableTestFeatureForImage\":true,\"EnableSignedContainerImage\":true,\"EnableItaVerifier\":true,\"FloatFeature\":-5.6,\"OtherTestFeatureForImage\":false,\"EnableVerifyCS\":true}",
34+
input: "{\"EnableTestFeatureForImage\":true,\"EnableSignedContainerImage\":true,\"EnableItaVerifier\":true,\"FloatFeature\":-5.6,\"OtherTestFeatureForImage\":false}",
3535
expectedExps: Experiments{
3636
EnableTestFeatureForImage: true,
3737
EnableItaVerifier: true,
38-
EnableVerifyCS: true,
3938
EnableGpuGcaSupport: false,
4039
},
4140
},
@@ -58,6 +57,13 @@ func TestExperiments(t *testing.T) {
5857
EnableGpuGcaSupport: true,
5958
},
6059
},
60+
{
61+
input: "{\"EnableTestFeatureForImage\":true,\"EnableItaVerifier\":false,\"NonExistantExperiment\":true,\"EnableVerifyCS\":true}",
62+
expectedExps: Experiments{
63+
EnableTestFeatureForImage: true,
64+
EnableItaVerifier: false,
65+
},
66+
},
6167
}
6268

6369
for i, test := range tests {

0 commit comments

Comments
 (0)