aboutsummaryrefslogtreecommitdiff
path: root/src/feature
AgeCommit message (Collapse)Author
2021-02-23Merge branch 'ticket40282_046_01_squashed'Nick Mathewson
2021-02-22Merge remote-tracking branch 'tor-gitlab/mr/276'Alexander Færøy
2021-02-22dos: New client connect rate detectionDavid Goulet
This is a new detection type which is that a relay can now control the rate of client connections from a single address. The mechanism is pretty simple, if the rate/burst is reached, the address is marked for a period of time and any connection from that address is denied. Closes #40253 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-22Merge remote-tracking branch 'tor-gitlab/mr/319'Nick Mathewson
2021-02-22Merge branch 'maint-0.4.5'Nick Mathewson
2021-02-22Merge remote-tracking branch 'tor-gitlab/mr/316' into maint-0.4.5Nick Mathewson
2021-02-22relay: Reduce streaming compression ratio from HIGH to LOWDavid Goulet
Fixes #40301 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-22Merge branch 'maint-0.4.5'Alexander Færøy
2021-02-22Merge remote-tracking branch 'tor-gitlab/mr/309' into maint-0.4.5Alexander Færøy
2021-02-22relay: Move log notice after suggested address lookupDavid Goulet
When trying to find our address to publish, we would log notice if we couldn't find it from the cache but then we would look at the suggested cache (which contains the address from the authorities) in which we might actually have the address. Thus that log notice was misplaced. Move it down after the suggested address cache lookup. Closes #40300 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-22relay: Only authorities publish a DirPortDavid Goulet
Relay will always publish 0 as DirPort value in their descriptor from now on except authorities. Related to #40282 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-22relay: Remove dirport reachability self testDavid Goulet
Regular relays are about to get their DirPort removed so that reachability test is not useful anymore Authorities will still use the DirPort but because network reentry towards their DirPort is now denied network wide, this test is not useful anymore and so it should simply be considered reachable at all time. Part of #40282 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-22Fix CID 1473233 in handle_control_hsfetch().George Kadianakis
With v2 support for HSFETCH gone, we only support v3 addresses. We don't support v2 descriptor IDs anymore and hence we can remove that code. The code removed would ensure that if a v2 descriptor ID was provided, the user also had to provide HSDirs explicitly. In the v3 case, the code should work even if no HSDirs are provided, and Tor would find the HSDirs itself.
2021-02-19Make dirauths vote the Sybil flag when other flags are zeroed outNeel Chauhan
2021-02-19hs-v2: Warn of v2 obsolete if configuredDavid Goulet
For a user using "HiddenServiceVersion 2", a log warning is emitted indicating that v2 is now obsolete instead of a confusing message saying that the version is not supported. Also, if an introduction point gets a legacy (v2) ESTABLISH_INTRO, we'll simply close the circuit without emitting a protocol warning log onto the relay. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs: Remove last artefact of HSv2 in the codeDavid Goulet
Closes #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs: Remove v2 code from HS circuitmapDavid Goulet
Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs: Remove v2 statsDavid Goulet
We still keep v2 rendezvous stats since we will allow them until the network has entirely phased out. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19man: Cleanup of v2 options and configDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19or: Cleanup or.h header of HSv2 codeDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs: Remove introduction point v2 supportDavid Goulet
Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs-v2: Removal of service and relay supportDavid Goulet
This is unfortunately massive but both functionalities were extremely intertwined and it would have required us to actually change the HSv2 code in order to be able to split this into multiple commits. After this commit, there are still artefacts of v2 in the code but there is no more support for service, intro point and HSDir. The v2 support for rendezvous circuit is still available since that code is the same for the v3 and we will leave it in so if a client is able to rendezvous on v2 then it can still transfer traffic. Once the entire network has moved away from v2, we can remove v2 rendezvous point support. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs: Rename service config port objectDavid Goulet
Remove it from rendservice.c and move everything related to hs_common.{c|h}. Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19hs-v2: Remove client supportDavid Goulet
Related to #40266 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-19Disable the dump_desc() function.Nick Mathewson
It can be called with strings that should have been length-delimited, but which in fact are not. This can cause a CPU-DoS bug or, in a worse case, a crash. Since this function isn't essential, the best solution for older Tors is to just turn it off. Fixes bug 40286; bugfix on 0.2.2.1-alpha when dump_desc() was introduced.
2021-02-19Merge remote-tracking branch 'tor-gitlab/mr/308'George Kadianakis
2021-02-17relay: No longer test dirport reachability for authoritiesRoger Dingledine
Now that exit relays don't allow exit connections to directory authority DirPorts, the follow-up step is to make directory authorities stop doing DirPort reachability checks. Fixes #40287 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-17metrics: Handle the connection finished flushing eventDavid Goulet
Turns out, we forgot to add the METRICS connection type fo the finished flushing handler. Fixes #40295 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-12Merge branch 'maint-0.4.5'David Goulet
2021-02-12Merge branch 'tor-gitlab/mr/304' into maint-0.4.5David Goulet
2021-02-12config: Do not compare for duplicate ORPorts with different addressesDavid Goulet
We were just looking at the family which is not correct because it is possible to have two explicit ORPort for the same family but different addresses. One example is: ORPort 127.0.0.1:9001 NoAdvertise ORPort 1.2.3.4:9001 NoListen Thus, this patch now ignores ports that have different addresses iff they are both explicits. That is, if we have this example, also two different addresses: ORPort 9001 ORPort 127.0.0.1:9001 NoAdvertise The first one is implicit and second one is explicit and thus we have to consider them for removal which in this case would remove the "ORPort 9001" in favor of the second port. Fixes #40289 Signe-off-by: David Goulet <dgoulet@torproject.org>
2021-02-12Merge branch 'maint-0.4.5'David Goulet
2021-02-12Merge branch 'tor-gitlab/mr/302' into maint-0.4.5David Goulet
2021-02-12Merge branch 'maint-0.4.5'Alexander Færøy
2021-02-12Merge remote-tracking branch 'tor-gitlab/mr/293' into maint-0.4.5Alexander Færøy
2021-02-12Merge branch 'maint-0.4.5'George Kadianakis
2021-02-12Merge remote-tracking branch 'tor-gitlab/mr/295' into maint-0.4.5George Kadianakis
2021-02-10relay: Don't look at omit flag when building descriptorDavid Goulet
That comes from 685c4866acf8489c58aca41ec01aa5a53e39220a which added that check correctly except for when we build a descriptor. We already omit the IPv6 address, if we need to, when we encode the descriptor but we need to keep the actual discovered address in the descriptor so we can notice future IP changes and be able to assess that we are not publishable as long as we don't specifically set the omit flag. This lead to also having tor noticing that our IP changed from <nothing> (no IPv6 in the descriptor) to a discovered one which would trigger every minute. Fixes #40279, #40288 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-08Merge branch 'maint-0.4.5'Nick Mathewson
2021-02-08Merge remote-tracking branch 'tor-gitlab/mr/296' into maint-0.4.5Nick Mathewson
2021-02-08Merge branch 'maint-0.4.5'Nick Mathewson
2021-02-08conn: Properly close MetricsPort socket on EOFDavid Goulet
Handle the EOF situation for a metrics connection. Furthermore, if we failed to fetch the data from the inbuf properly, mark the socket as closed because the caller, connection_process_inbuf(), assumes that we did so on error. Fixes #40257 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-08Don't log supported-protover warnings if consensus is older than Tor.Nick Mathewson
Previously we would warn in this case... but there's really no justification for doing so, and it can only cause confusion. Fixes bug #40281; bugfix on 0.4.0.1-alpha.
2021-02-08relay: Look at the omit IPv6 flag when publishingDavid Goulet
In two instances we must look at this flag: 1. When we build the descriptor so the IPv6 is NOT added to the descriptor in case we judge that we need to omit the address but still publish. 2. When we are deciding if the descriptor is publishable. This flags tells us that the IPv6 was not found reachable but we should still publish. Fixes #40279 Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-08relay: Fix Coverity warning for unchecked returned valueDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2021-02-08Merge branch 'bug40249_squashed'Nick Mathewson
2021-02-08Add stream ID to ADDRMAP control eventNeel Chauhan
2021-02-08Merge remote-tracking branch 'tor-gitlab/mr/212'George Kadianakis
2021-02-03Add missing newline between get_all_possible_sybil() and version_from_platform()Neel Chauhan
2021-02-03Merge branch 'maint-0.4.5'David Goulet