aboutsummaryrefslogtreecommitdiff
path: root/src/feature/control
AgeCommit message (Collapse)Author
2021-05-27Merge branch 'maint-0.4.6'David Goulet
2021-05-27Merge branch 'tor-gitlab/mr/392' into maint-0.4.6David Goulet
2021-05-26Prefer mmap()ed consensus files over cached_dir_t entries.Nick Mathewson
Cached_dir_t is a somewhat "legacy" kind of storage when used for consensus documents, and it appears that there are cases when changing our settings causes us to stop updating those entries. This can cause trouble, as @arma found out in #40375, where he changed his settings around, and consensus diff application got messed up: consensus diffs were being _requested_ based on the latest consensus, but were being (incorrectly) applied to a consensus that was no longer the latest one. This patch is a minimal fix for backporting purposes: it has Tor do the same search when applying consensus diffs as we use to request them. This should be sufficient for correct behavior. There's a similar case in GETINFO handling; I've fixed that too. Fixes #40375; bugfix on 0.3.1.1-alpha.
2021-05-10Fix typo in comment for handle_control_redirectstream()Neel Chauhan
2021-03-17Merge branch 'maint-0.4.5'George Kadianakis
2021-03-12Run "make autostyle" in advance of new series.Nick Mathewson
2021-03-12Update copyrights to 2021, using "make update-copyright"Nick Mathewson
2021-03-08Don't warn about missing guard state if controller picked first hopNick Mathewson
See comments about why this needs a new flag and we can't just use CIRCUIT_PURPOSE_CONTROLLER. Fixes #40285; bugfix on 0.3.2.1-alpha.
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-19hs: Remove last artefact of HSv2 in the codeDavid Goulet
Closes #40266 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-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-08Merge branch 'bug40249_squashed'Nick Mathewson
2021-02-08Add stream ID to ADDRMAP control eventNeel Chauhan
2020-12-08Reinstate add_onion_helper_add_service() test, validate auth clients before ↵Neel Chauhan
adding them
2020-12-03More logic correctionsNeel Chauhan
2020-11-24Some test and logic correctionsNeel Chauhan
2020-11-19Add tests for bug #40084Neel Chauhan
2020-11-15Add support for creating v3 onion services form the control portNeel Chauhan
2020-11-12Fix typos.Samanta Navarro
Typos found with codespell. Please keep in mind that this should have impact on actual code and must be carefully evaluated: src/core/or/lttng_circuit.inc - ctf_enum_value("CONTROLER", CIRCUIT_PURPOSE_CONTROLLER) + ctf_enum_value("CONTROLLER", CIRCUIT_PURPOSE_CONTROLLER)
2020-11-03Merge remote-tracking branch 'tor-gitlab/mr/185' into masterGeorge Kadianakis
2020-10-28Remove "GETINFO network-status".Nick Mathewson
It was deprecated 0.3.1.1-alpha. According to #22473, nothing uses it. Closes #22473.
2020-10-28Revise fix for bug 32178 (spaces at end of log msg).Nick Mathewson
The loop in the earlier patch would invoke undefined behavior in two ways: First, it would check whether it was looking at a space before it checked whether the pointer was in-range. Second, it would let a pointer reach a position _before_ the start of a string, which is not allowed. I've removed the assertion about empty messages: empty messages can be their own warning IMO. I've also added tests for this formatting code, to make sure it actually works.
2020-10-28Removes trailing spaces in control event logAmadeusz Pawlik
2020-10-27conn: New Metrics listener portDavid Goulet
If MetricsPort is defined, listen on it and handle the incoming request. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-10-19Explain why we use "mark_as_used_for_origin_circuit" where we doNick Mathewson
Also, explain why it's relevant for bootstrapping. This is a comments-only patch.
2020-09-18Add flag for whether an OR conn "counts" for bootstrap trackingNick Mathewson
We set this flag if we've launched the connection in order to satisfy an origin circuit, or when we decide the connection _would_ satisfy an origin circuit. These are the only or_connections we want to consider for bootstrapping: other or_connections are opened because of client EXTEND requests, and they may succeed or fail because of the clients' confusion or misconfiguration. Closes #25061.
2020-08-20Merge branch 'maint-0.4.4'George Kadianakis
2020-08-20v3 control: Persist ONION_CLIENT_AUTH_ADD client nameNeel Chauhan
2020-08-11Remove extraneous EVENT_CONTROLLER_WAITNick Mathewson
This turned into a new StreamStatus value. Closes #40092. Bug not in any released Tor.
2020-08-04ipv6: Specialize GETINFO address interface for v4 and v6Neel Chauhan
2020-08-03Merge remote-tracking branch 'tor-github/pr/1986/head'Nick Mathewson
2020-07-31Code simplifications for AP_CONN_STATE_CONTROLLER_WAITNeel Chauhan
2020-07-29Merge remote-tracking branch 'tor-github/pr/1987/head'Nick Mathewson
2020-07-20relay: Use flags in relay_find_addr_to_publish()David Goulet
Instead of a boolean saying "cache_only" add the concept of flags so we add semantic through out the code and allow ourselves to have more options in the future. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-20control: With GETINFO, don't trigger an address resolveDavid Goulet
Tell the relay find address interface to only use the cache so we don't trigger an address resolve everytime the "GETINFO address" is called. Related #40025 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-20control: GETINFO address/ use new find address APIDavid Goulet
At the moment, this command only returns the IPv4. Do so by using the new relay_find_addr_to_publish(). New commands to return IPv4 and IPv6 will be done with the work in tor#40039. Related to #40025 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-07-16Use CONST_TO_* macros in more places.Nick Mathewson
This is an automated commit made with a python script. After running the automated script, I had to hand-revert the cases where it made the conversion functions call themselves. Additionally, I had to edit a variable declaration in control_bootstrap.c so that the result of a const cast could be put in a const field.
2020-07-16Define new CONST_TO_*_CONN() functions for const-to-const castsNick Mathewson
These names are analogous to the CONST_TO_*_CIRC() functions we have for circuits. Part of #40046.
2020-07-16Improve documentation for our TO_*_CONN() cast functions.Nick Mathewson
Preliminary work for #40046.
2020-07-08Remove duplicate #include control_events.h in control_cmd.cNeel Chauhan
2020-07-08Send a control port event when a stream enters the ↵Neel Chauhan
AP_CONN_STATE_CONTROLLER_WAIT state
2020-07-02Extract extend_info manipulation functions into a new file.Nick Mathewson
2020-07-01Merge branch 'tor-github/pr/1907'David Goulet
2020-07-01control: Add a key to GETINFO to fetch the circuit onion handshake rephist ↵Neel Chauhan
values
2020-06-26Merge branch 'assume_reachable_revamp'Nick Mathewson
2020-06-24Merge branch 'tor-github/pr/1935'David Goulet
2020-06-24Make HSFETCH take the decoded length into account, not the base32 oneNeel Chauhan