diff --git a/internal/experiment/echcheck/handshake.go b/internal/experiment/echcheck/handshake.go index 05a4e2526..080444cf1 100644 --- a/internal/experiment/echcheck/handshake.go +++ b/internal/experiment/echcheck/handshake.go @@ -34,7 +34,9 @@ func handshakeWithEch(ctx context.Context, conn net.Conn, zeroTime time.Time, utlsEchExtension.Id = echExtensionType utlsEchExtension.Data = payload - return handshakeWithExtension(ctx, conn, zeroTime, address, sni, []utls.TLSExtension{&utlsEchExtension}, logger) + hs := handshakeWithExtension(ctx, conn, zeroTime, address, sni, []utls.TLSExtension{&utlsEchExtension}, logger) + hs.ECHConfig = "GREASE" + return hs } func handshakeMaybePrintWithECH(doprint bool) string { diff --git a/internal/experiment/echcheck/measure.go b/internal/experiment/echcheck/measure.go index 1bfe0e2b6..bd1d12ffb 100644 --- a/internal/experiment/echcheck/measure.go +++ b/internal/experiment/echcheck/measure.go @@ -16,7 +16,7 @@ import ( const ( testName = "echcheck" - testVersion = "0.1.2" + testVersion = "0.2.0" defaultURL = "https://cloudflare-ech.com/cdn-cgi/trace" ) @@ -30,8 +30,7 @@ var ( // TestKeys contains echcheck test keys. type TestKeys struct { - Control model.ArchivalTLSOrQUICHandshakeResult `json:"control"` - Target model.ArchivalTLSOrQUICHandshakeResult `json:"target"` + TLSHandshakes []*model.ArchivalTLSOrQUICHandshakeResult `json:"tls_handshakes"` } // Measurer performs the measurement. @@ -124,7 +123,7 @@ func (m *Measurer) Run( control := <-controlChannel target := <-targetChannel - args.Measurement.TestKeys = TestKeys{Control: control, Target: target} + args.Measurement.TestKeys = TestKeys{TLSHandshakes: []*model.ArchivalTLSOrQUICHandshakeResult{&control, &target}} return nil } diff --git a/internal/experiment/echcheck/measure_test.go b/internal/experiment/echcheck/measure_test.go index 2a53fbd93..14ae2b292 100644 --- a/internal/experiment/echcheck/measure_test.go +++ b/internal/experiment/echcheck/measure_test.go @@ -114,10 +114,13 @@ func TestMeasurementSuccessRealWorld(t *testing.T) { // check results tk := msrmnt.TestKeys.(TestKeys) - if tk.Control.Failure != nil { - t.Fatal("unexpected control failure:", *tk.Control.Failure) - } - if tk.Target.Failure != nil { - t.Fatal("unexpected target failure:", *tk.Target.Failure) + for _, hs := range tk.TLSHandshakes { + if hs.Failure != nil { + if hs.ECHConfig == "GREASE" { + t.Fatal("unexpected exp failure:", hs.Failure) + } else { + t.Fatal("unexpected ctrl failure:", hs.Failure) + } + } } } diff --git a/internal/model/archival.go b/internal/model/archival.go index 8a17e745e..affa15c33 100644 --- a/internal/model/archival.go +++ b/internal/model/archival.go @@ -248,6 +248,7 @@ type ArchivalTLSOrQUICHandshakeResult struct { NoTLSVerify bool `json:"no_tls_verify"` PeerCertificates []ArchivalBinaryData `json:"peer_certificates"` ServerName string `json:"server_name"` + ECHConfig string `json:"echconfig,omitempty"` T0 float64 `json:"t0,omitempty"` T float64 `json:"t"` Tags []string `json:"tags"`