aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2023-06-19Change git.tpo URLs to gitlab.tpoDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-01-12dirauth: Reject 0.4.6.x series at the authority levelDavid Goulet
Closes #40664 Signed-off-by: David Goulet <dgoulet@torproject.org>
2023-01-10shellcheck: Fix new warningsDavid Goulet
Nothing important, mostly false positive except one case. Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-11-09dns: Make TTLs fuzzy at exit relaysRasmus Dahlberg
This change mitigates DNS-based website oracles by making the time that a domain name is cached uncertain (+- 4 minutes of what's measurable). Resolves TROVE-2021-009. Fixes #40674
2022-11-01Clip DNS TTL values once in event callbackRasmus Dahlberg
This change ensures that other parts of the code base always operate on the same clipped TTL values, notably without being aware of clipping.
2022-10-28thread: Bump max detectable CPU from 16 to 128David Goulet
Lets take advantage of those beefy machines ;). Closes #40703 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-10-26Merge branch 'maint-0.4.5' into maint-0.4.7David Goulet
2022-10-26dirauth: Remove FaravaharDavid Goulet
Closes #40688 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-03-15test: Unit tests for overload onionskin ntorDavid Goulet
Part of #40560 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-23Merge branch 'tor-gitlab/mr/488'David Goulet
2022-02-23Reject intro2 cells that request unadvertized congestion control.Mike Perry
2022-02-22Add test for sendme_inc validation.Mike Perry
2022-02-22Add test for sendme_cell_is_next with sendme_inc of 31Mike Perry
2022-02-22Add test for circuit_sendme_cell_is_next() when sendme_inc is 100.Mike Perry
This ensures compatibility with old tor.
2022-02-22hs: Fix tests for congestion controlDavid Goulet
2022-02-22hs: Decode flow-control lineDavid Goulet
This puts the flow control version (unparsed) in the descriptor. The client doesn't use it yet. Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-22trunnel: Make hs/cell_common.trunnel genericDavid Goulet
Move it to extension.trunnel instead so that extension ABI construction can be used in other parts of tor than just HS cells. Specifically, we'll use it in the ntorv3 data payload and make a congestion control parameter extension using that binary structure. Only rename. No code behavior changes. Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-22Add test for congestion control negotiation logic.Mike Perry
2022-02-22Add test for TAP vs ntor2+ntor3 onion queue orderingMike Perry
2022-02-22Extend info argument updates for non-ntorv3 casesMike Perry
2022-02-22Use protover to signal support for ntor3 + congestion control.Nick Mathewson
2022-02-16dirauth: Reject EOL 0.3.5.x relaysDavid Goulet
Closes #40559 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-02-03Merge branch 'maint-0.4.6'David Goulet
2022-02-03Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
2022-02-03hs: Double quote the metrics label valueDavid Goulet
Fixes #40552 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-01-19Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
2022-01-19Merge branch 'maint-0.4.6'David Goulet
2022-01-19test: Remove HSv2 protover specific testDavid Goulet
HSv2 is not advertised as a supported protocol version anymore. This was introduced with the merge-forward of commit 72041c63064b461e which didn't fix the unit test. Fixes #40549 Signed-off-by: David Goulet <dgoulet@torproject.org>
2022-01-18Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
2022-01-18Merge branch 'maint-0.4.6'David Goulet
2022-01-18Merge branch 'maint-0.3.5' into maint-0.4.5David Goulet
2022-01-18relay: Don't advertise HSv2 protocol versionDavid Goulet
We removed HSIntro=3 and HSDir=1 that are v2 specific. Since 0.3.5.17, we do not support introducing or being a directory for onion service v2. Closes #40509 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-12-14fixup! relay: Change DNS timeout label on MetricsPortDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-12-13Merge branch 'ticket40527_046_01' into ticket40527_047_01David Goulet
2021-12-13relay: Don't make DNS timeout trigger an overloadDavid Goulet
Tor has configure libevent to attempt up to 3 times a DNS query for a maximum of 5 seconds each. Once that 5 seconds has elapsed, it consider the query "Timed Out" but tor only gets a timeout if all 3 attempts have failed. For example, using Unbound, it has a much higher threshold of timeout. It is well defined in https://www.nlnetlabs.nl/documentation/unbound/info-timeout/ and has some complexity to it. But the gist is that if it times out, it will be much more than 5 seconds. And so the Tor DNS timeouts are more of a "UX issue" rather than a "network issue". For this reason, we are removing this metric from the overload general signal. See https://gitlab.torproject.org/tpo/network-health/team/-/issues/139 for more information. Fixes #40527 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-19Don't kill managed proxy on method errorCecylia Bocovich
Some PT applications support more than one transport. For example, obfs4proxy supports obfs4, obfs3, and meek. If one or more transports specified in the torrc file are supported, we shouldn't kill the managed proxy on a {C,S}METHOD-ERROR. Instead, we should log a warning. We were already logging warnings on method errors. This change just makes sure that the managed proxy isn't killed, and then if no transports are configured for the managed proxy, bumps the log level up from a notice to a warning. Closes #7362
2021-11-08Merge remote-tracking branch 'tor-gitlab/mr/480' into mainAlexander Færøy
2021-11-08fix an already-existing bug in the unit testsRoger Dingledine
where the or_conn for testing the failure cache would be initialized with random stack data, so e.g. its potentially_used_for_bootstrapping field would start out at some random value.
2021-11-05Merge branch 'maint-0.4.5' into maint-0.4.6David Goulet
2021-11-05Merge branch 'maint-0.4.6'David Goulet
2021-11-05protover: Fix merge forward from 035David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-11-05sandbox: Allow "statx" syscall on i386 for glibc 2.33Simon South
glibc versions 2.33 and newer use the modern "statx" system call in their implementations of stat() and opendir() for Linux on i386. Prevent failures in the sandbox unit tests by modifying the sandbox to allow this system call without restriction on i386 when it is available, and update the test suite to skip the "sandbox/stat_filename" test in this case as it is certain to fail.
2021-11-05test: Skip sandbox/stat_filename where "stat64" syscall definedSimon South
On 32-bit architectures where Linux provides the "stat64" system call, including i386, the sandbox is unable to filter calls to stat() as glibc uses this system call itself internally and the sandbox must allow it without restriction. Update the sandbox unit tests to skip the "sandbox/stat_filename" test on systems where the "stat64" system call is defined and the test is certain to fail. Also reorder the "#if" statement's clauses to correspond with the comment preceding it, for clarity.
2021-10-29Fix Windows build.Alexander Færøy
While trying to resolve our CI issues, the Windows build broke with an unused function error: src/test/test_switch_id.c:37:1: error: ‘unprivileged_port_range_start’ defined but not used [-Werror=unused-function] We solve this by moving the `#if !defined(_WIN32)` test above the `unprivileged_port_range_start()` function defintion such that it is included in its body. This is an unreviewed commit. See: tor#40275
2021-10-24fetch missing bridge descriptors without delayRoger Dingledine
Without this change, if we have a working bridge, and we add a new bridge, we will schedule the fetch attempt for that new bridge descriptor for three hours(!) in the future. This change is especially needed because of bug #40396, where if you have one working bridge and one bridge whose descriptor you haven't fetched yet, your Tor will stall until you have successfully fetched that new descriptor -- in this case for hours. In the old design, we would put off all further bridge descriptor fetches once we had any working bridge descriptor. In this new design, we make the decision per bridge based on whether we successfully got *its* descriptor. To make this work, we need to also call learned_bridge_descriptor() every time we get a bridge descriptor, not just when it's a novel descriptor. Fixes bug 40396. Also happens to fix bug 40495 (redundant descriptor fetches for every bridge) since now we delay fetches once we succeed. A side effect of this change is that if we have any configured bridges that *aren't* working, we will keep trying to fetch their descriptors on the modern directory retry schedule -- every couple of seconds for the first half minute, then backing off after that -- which is a lot faster than before.
2021-10-21Merge branch 'tor-gitlab/mr/452_squashed' into mainAlexander Færøy
2021-10-21Implement a MiddleOnly flag for vote generation.Nick Mathewson
This proposal implements part of Prop335; it's based on a patch from Neel Chauhan. When configured to do so, authorities will assign a MiddleOnly flag to certain relays. Any relay which an authority gives this flag will not get Exit, V2Dir, Guard, or HSDir, and might get BadExit if the authority votes for that one.
2021-10-21Merge branch 'maint-0.4.5' into maint-0.4.6Alexander Færøy
2021-10-21Merge remote-tracking branch 'tor-gitlab/mr/338' into maint-0.4.5Alexander Færøy
2021-10-20relay: Overload state on DNS timeout is now X% over Y secsDavid Goulet
With this commit, we will only report a general overload state if we've seen more than X% of DNS timeout errors over Y seconds. Previous behavior was to report when a single timeout occured which is really too small of a threshold. The value X is a consensus parameters called "overload_dns_timeout_scale_percent" which is a scaled percentage (factor of 1000) so we can represent decimal points for X like 0.5% for instance. Its default is 1000 which ends up being 1%. The value Y is a consensus parameters called "overload_dns_timeout_period_secs" which is the time period for which will gather DNS errors and once over, we assess if that X% has been reached ultimately triggering a general overload signal. Closes #40491 Signed-off-by: David Goulet <dgoulet@torproject.org>