Commit graph

278 commits

Author SHA1 Message Date
Anthony Chang
32e864b71d
Add unit tests for SQS rendezvous in client
Co-authored-by: Michael Pu <michael.pu@uwaterloo.ca>
2024-01-22 13:11:03 -05:00
Anthony Chang
f3b062ddb2
Add mocks and interfaces for testing SQS rendezvous
Co-authored-by: Michael Pu <michael.pu@uwaterloo.ca>
2024-01-22 13:10:56 -05:00
Michael Pu
8fb17de152
Implement SQS rendezvous in client and broker
This features adds an additional rendezvous method to send client offers
and receive proxy answers through the use of Amazon SQS queues.

https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/26151
2024-01-22 13:06:42 -05:00
David Fifield
d0529141ac Cosmetic fixes taken from !219.
shelikhoo/dev-udp-performance-rebased branch
https://gitlab.torproject.org/shelikhoo/snowflake/-/commits/9dce28cfc2093490473432ffecd9abaab7ebdbdb
2024-01-16 18:43:58 +00:00
Arlo Breault
98db63ad01 Update recommended torrc options in the client readme
For #40294
2024-01-04 17:36:22 +00:00
David Fifield
aa06e7bef3 Merge branch 'encapsulation-readdata-buffer' 2023-11-21 03:46:46 +00:00
David Fifield
234d9cb11c Link a section in the pion/webrtc@3.0.0 release notes. 2023-11-21 01:27:09 +00:00
David Fifield
d99f31d881 Have encapsulation.ReadData return an error when the buffer is short.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/154#note_2919109

Still ignoring the io.ErrShortBuffer at the callers, which retains
current behavior.
2023-11-07 05:51:35 +00:00
David Fifield
001f691b47 Have encapsulation.ReadData read into a provided buffer.
Instead of unconditionally allocating its own.
2023-11-07 05:51:35 +00:00
Cecylia Bocovich
10fb9afaa7
Check if multiple front domains argument is empty
This fixes a regression introduced in 9fdfb3d1, where the list of front
domains always contained an empty string if none were supplied via the
commandline options, causing rendezvous failures for both amp cache and
domain fronting. This fix checks to see whether the commandline option
was supplied.
2023-10-26 17:04:56 -04:00
Shelikhoo
5df7a06eee
Add outbound proxy configuration propagation 2023-10-24 17:47:25 +01:00
Cecylia Bocovich
d434549df8
Maintain backward compatability with old clients
Introduce a new commandline and SOCKS argument for comma-separated
domain fronts rather than repurposing the old one so that we can
maintain backwards compatability with users running old versions of the
client. A new bridge line shared on circumvention settings could have
both the front= and fronts= options set.
2023-10-05 17:51:56 -04:00
Cecylia Bocovich
9fdfb3d1b5
Randomly select front domain from comma-separated list
This commmit changes the command-line and Bridge line arguments to take
a comma-separated list of front domains. The change is backwards
compatible with old Bridge and ClientTransportPlugin lines. At
rendezvous time, a front domain will be randomly chosen from the list.
2023-10-05 17:51:56 -04:00
Cecylia Bocovich
b632c7d49c
Workaround for shadow in lieu of AF_NETLINK support
For details, see https://github.com/shadow/shadow/issues/2980
2023-08-24 16:33:22 +01:00
Cecylia Bocovich
f8eb86f24d
Append Let's Encrypt ISRG Root X1 to cert pool
This is a workaround for older versions of android that do not trust
the Let's Encrypt root certificate.
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40087
2023-06-14 18:12:29 -04:00
meskio
82cc0f38f7
Move the development to gitlab
Related: tpo/anti-censorship/team#86
2023-05-31 10:01:47 +02:00
itchyonion
07b5f07452
Validate SDP offers and answers 2023-05-29 10:12:48 -07:00
meskio
297ca91b1d
Use goptlib from gitlab.torproject.org 2023-04-19 17:15:35 +02:00
itchyonion
990fcb4127
Filter out non stun: server addresses in ParseIceServers 2023-01-30 09:10:15 -08:00
itchyonion
66269c07d8
Update README to correctly reflec the type of ICE servers we currently support 2023-01-30 09:10:15 -08:00
itchyonion
a6a18c1a9b
Parse ICE servers with pion/ice library function 2023-01-30 09:10:15 -08:00
David Fifield
b443e99417 Bring client torrc up to date with Tor Browser fc89e8b1.
https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/commits/fc89e8b10c3ff30db2079b2fb327d05b2b5f3c80/projects/common/bridges_list.snowflake.txt

* Use port 80 in placeholder IP addresses
  tpo/applications/tor-browser-build!516
* Enable uTLS
  tpo/applications/tor-browser-build!540
* Shorten bridge line (remove stun.voip.blackberry.com)
  tpo/applications/tor-browser-build!558
* Add snowflake-02 bridge
  tpo/applications/tor-browser-build!571
2023-01-19 11:37:23 -07:00
Cecylia Bocovich
7db2568448
Remove duplicate stun.sonetel.net entry 2023-01-03 10:32:03 -05:00
Cecylia Bocovich
8c775562c1
Remove two suggested STUN servers from client docs
Removed stun.stunprotocol.org after a discussion with the operator, and
stun.altar.com.pl after noticing it has gone offline.

https://lists.torproject.org/pipermail/anti-censorship-team/2022-December/000272.html
https://lists.torproject.org/pipermail/anti-censorship-team/2022-December/000276.html
2022-12-31 12:23:29 -05:00
Shelikhoo
4ebd85e5d1
add version output to log 2022-11-23 12:29:55 +00:00
Shelikhoo
33248f3dec
Add Version Output Support to Snowflake
From now on, there will be a file at common/version/version.go that includes current version number.
2022-11-23 12:29:51 +00:00
luciole
2c599f8827
change bandwidth type from int to int64 to prevent overflow 2022-11-21 10:33:21 -05:00
Cecylia Bocovich
31b958302e Bump minimum go version to 1.15 2022-10-12 11:03:06 -04:00
trinity-1686a
5ef5142bb0 format using go-1.19 2022-10-09 21:15:50 +02:00
Tommaso Gragnato
9ce1de4eee Use Pion's Setting Engine to reduce Multicast DNS noise
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/issues/40123

The purpose of the patch is to prevent Pion from opening the mDNS port,
thus preventing snowflake from directly leaking .local candidates.

What this doesn't prevent is the resolution of .local candidates
once they are passed on to the system DNS.
2022-09-26 08:52:23 -07:00
itchyonion
e4c01f0595 Wrap client NAT log 2022-05-31 08:52:23 -07:00
meskio
3473b438e5
Move ptEventLogger into the client/snowflake.go
Remove client/pt_event_logger.go file as is very minimal.
2022-05-25 18:09:09 +02:00
meskio
1d592b06e5
Implement String() method on events
To make it safe for logging safelog.Scrub function is now public.

Closes: #40141
2022-05-25 18:09:06 +02:00
itchyonion
e2838201ad
Scrub ptEvent logs 2022-04-12 11:52:21 -04:00
Cecylia Bocovich
d807e9d370
Move tor-specific code outside of client library 2022-04-11 11:38:52 -04:00
Arlo Breault
b563141c6a Forward bridge fingerprint
gitlab 28651
2022-03-21 15:06:05 -04:00
Arlo Breault
281d917beb Stop storing version in ClientPollRequest
This continues to asserts the known version while decoding.  The client
will only ever generate the latest version while encoding and if the
response needs to change, the impetus will be a new feature, set in the
deserialized request, which can be used as a distinguisher.
2022-03-21 15:06:05 -04:00
Arlo Breault
bd636a1374 Introduce an unexported newBrokerChannelFromConfig
A follow-up wants to pass in a new property from the ClientConfig but it
would be an API breaking change to NewBrokerChannel.

However, it's unclear why NewBrokerChannel is exported at all.  No other
package in the repo depends on it and the known users of the library
probably wouldn't be construct them.

While this patch was being reviewed, a new constructor was added,
NewBrokerChannelWithUTLSSettings, with effectively the same issue.
Both of those exported ones are deleted here.
2022-03-16 16:33:24 -04:00
Arlo Breault
829cacac5f Parse ClientPollRequest version in DecodeClientPollRequest
Instead of IPC.ClientOffers.  This makes things consistent with
EncodeClientPollRequest which adds the version while serializing.
2022-03-16 15:43:10 -04:00
Arlo Breault
6fd0f1ae5d Rename *PollRequest methods to distinguish client/proxy 2022-03-16 15:43:10 -04:00
Shelikhoo
ab9604476e
Move uTLS configuration to socks5 arg 2022-03-16 09:13:30 +00:00
Shelikhoo
8d5998b744
Harmonize identifiers to uTLS 2022-03-16 09:13:29 +00:00
Shelikhoo
e3aeb5fe5b
Add line wrap to NewBrokerChannelWithUTlsSettings 2022-03-16 09:13:29 +00:00
Shelikhoo
1573502e93
Use uTLS aware broker channel constructor 2022-03-16 09:13:29 +00:00
Shelikhoo
ccfdcab8fe
Add uTLS remove SNI to snowflake client 2022-03-16 09:13:29 +00:00
Shelikhoo
9af0ad119b
Add utls imitate setting to snowflake client 2022-03-16 09:13:29 +00:00
Cecylia Bocovich
01ae5b56e8
Fix client library test
Initialize eventsLogger for WebRTCPeer in client library test.
2022-02-14 15:11:41 -05:00
Cecylia Bocovich
3547b284a9
Make all snowflake events LogSeverityNotice
Let's reserve Tor error logs for more severe events that indicate
a client-side bug or absolute failure. By default, tor logs at severity
level notice (and above).
2022-02-14 14:09:16 -05:00
Cecylia Bocovich
2c008d6589
Add connection failure events for proxy timeouts
This change adds two new connection failure events for snowflake
proxies. One fires when the datachannel times out and another fires when
the connection to the proxy goes stale.
2022-02-14 14:00:01 -05:00
Shelikhoo
6cb82618a0
Refactor WebRTC Peer,Dialer's name to be readable
See also:
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/-/merge_requests/67#note_2771666
2022-01-25 12:49:59 +00:00