From 5f8a7675bf60c348e5c2d6ba61721f6d3bc98149 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Mon, 25 Mar 2024 16:10:38 +0100 Subject: [PATCH] fix(torsf): update domain fronting (#1531) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This diff updates snowflake's domain fronting such that `torsf` is working as intended again. I adapted this diff from https://github.com/ooni/probe-cli/pull/1529, written by @Lanius-collaris (thank you so much! 🥰 🙌). The original diff contained extra functionality that it would be very nice to have. I have chosen to drop this functionality, because I'd like to quickly merge a Snowflake fix. I will take care of the additional changes in a subsequent diff. Part of https://github.com/ooni/probe/issues/2692. --------- Co-authored-by: Lanius-collaris <55432068+Lanius-collaris@users.noreply.github.com> --- internal/experiment/torsf/integration_test.go | 1 - internal/experiment/torsf/torsf.go | 2 +- internal/experiment/torsf/torsf_test.go | 2 +- internal/ptx/snowflake.go | 4 ++-- internal/ptx/snowflake_test.go | 4 ++-- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/internal/experiment/torsf/integration_test.go b/internal/experiment/torsf/integration_test.go index 5de483f41a..c52735a2b5 100644 --- a/internal/experiment/torsf/integration_test.go +++ b/internal/experiment/torsf/integration_test.go @@ -13,7 +13,6 @@ import ( ) func TestRunWithExistingTor(t *testing.T) { - t.Skip("TODO(https://github.com/ooni/probe/issues/2692)") if testing.Short() { t.Skip("skip test in short mode") } diff --git a/internal/experiment/torsf/torsf.go b/internal/experiment/torsf/torsf.go index f61d6b9781..835f20753f 100644 --- a/internal/experiment/torsf/torsf.go +++ b/internal/experiment/torsf/torsf.go @@ -25,7 +25,7 @@ import ( // We may want to have a single implementation for both nettests in the future. // testVersion is the experiment version. -const testVersion = "0.5.0" +const testVersion = "0.5.1" // Config contains the experiment config. type Config struct { diff --git a/internal/experiment/torsf/torsf_test.go b/internal/experiment/torsf/torsf_test.go index f7c2301810..5ecc94e41e 100644 --- a/internal/experiment/torsf/torsf_test.go +++ b/internal/experiment/torsf/torsf_test.go @@ -25,7 +25,7 @@ func TestExperimentNameAndVersion(t *testing.T) { if m.ExperimentName() != "torsf" { t.Fatal("invalid experiment name") } - if m.ExperimentVersion() != "0.5.0" { + if m.ExperimentVersion() != "0.5.1" { t.Fatal("invalid experiment version") } } diff --git a/internal/ptx/snowflake.go b/internal/ptx/snowflake.go index cf6cd0c352..a48883f583 100644 --- a/internal/ptx/snowflake.go +++ b/internal/ptx/snowflake.go @@ -41,11 +41,11 @@ func (d *snowflakeRendezvousMethodDomainFronting) AMPCacheURL() string { } func (d *snowflakeRendezvousMethodDomainFronting) BrokerURL() string { - return "https://snowflake-broker.torproject.net.global.prod.fastly.net/" + return "https://1098762253.rsc.cdn77.org/" } func (d *snowflakeRendezvousMethodDomainFronting) FrontDomain() string { - return "foursquare.com" + return "www.phpmyadmin.net" } // NewSnowflakeRendezvousMethodAMP is a rendezvous method that diff --git a/internal/ptx/snowflake_test.go b/internal/ptx/snowflake_test.go index 0c2d8a6f26..c0e7802812 100644 --- a/internal/ptx/snowflake_test.go +++ b/internal/ptx/snowflake_test.go @@ -16,11 +16,11 @@ func TestSnowflakeMethodDomainFronting(t *testing.T) { if meth.AMPCacheURL() != "" { t.Fatal("invalid amp cache URL") } - const brokerURL = "https://snowflake-broker.torproject.net.global.prod.fastly.net/" + const brokerURL = "https://1098762253.rsc.cdn77.org/" if meth.BrokerURL() != brokerURL { t.Fatal("invalid broker URL") } - const frontDomain = "foursquare.com" + const frontDomain = "www.phpmyadmin.net" if meth.FrontDomain() != frontDomain { t.Fatal("invalid front domain") }