aboutsummaryrefslogtreecommitdiff
path: root/src/feature
AgeCommit message (Collapse)Author
2020-02-11nodelist: Helper to add an address to the nodelist address setDavid Goulet
We separate v4 and v6 because we often use an IPv4 address represented with a uint32_t instead of a tor_addr_t. This will be used to also add the trusted directory addresses taken from the configuration. The trusted directories from the consensus are already added to the address set from their descriptor. Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11mainloop: Remove unused parameter from connection_dir_is_global_write_low()David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11mainloop: Rename global_write_bucket_low()David Goulet
That function is only used to test the global bucket write limit for a directory connection. It should _not_ be used for anything else since that function looks to see if we are a directory authority. Rename it to something more meaningful. No change in behavior at this commit, only renaming. Part of #33029 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-25Merge remote-tracking branch 'tor-github/pr/1466' into maint-0.4.2teor
2019-10-25Merge remote-tracking branch 'tor-github/pr/1464' into maint-0.4.2teor
2019-10-24dir: Return 503 code when rejecting single hop requestDavid Goulet
Single hop rejection (POST and GET) for HS v3 descriptor now return a 503 code which is more accurate code from dir-spec.txt and from other rejection case in the code. For instance if you are not a relay and you get a POST request, a 503 code is sent back with a rejection message. Part of #31958 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-24dir: Remove connection_dir_is_anonymous() loggingDavid Goulet
First, remove the HSDir mention which should not be in that generic function. Second, move them to debug() level since they are possible error case. Part of #31958 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-24dir: Look if circuit is closed in connection_dir_is_anonymous()David Goulet
Before inspecting the p_chan, we must check if the circuit is marked for close because if it is the case, the channels are nullified from the circuit. Several valid cases can mark the circuit for close of the directory connection. Fixes #31958 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-24hs-v3: Remove a BUG() caused by an acceptable raceDavid Goulet
hs_client_purge_state() and hs_cache_clean_as_client() can remove a descriptor from the client cache with a NEWNYM or simply when the descriptor expires. Which means that for an INTRO circuit being established during that time, once it opens, we lookup the descriptor to get the IP object but hey surprised, no more descriptor. The approach here is minimalist that is accept the race and close the circuit since we can not continue. Before that, the circuit would stay opened and the client wait the SockTimeout. Fixers #28970. Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-23Merge remote-tracking branch 'tor-github/pr/1284' into maint-0.3.5teor
2019-10-23Merge remote-tracking branch 'tor-github/pr/1256' into maint-0.3.5teor
2019-10-20hibernate: Fix repeated "bytes" in commentteor
2019-10-20fix easy typosRoger Dingledine
2019-10-18Merge remote-tracking branch 'tor-github/pr/1396' into maint-0.4.2Nick Mathewson
2019-10-17Remove overly strict assertions in transports.c.Alexander Færøy
This patch removes an overly strict tor_assert() and an ignorable BUG() expression. Both of these would trigger if a PT was unable to configure itself during startup. The easy way to trigger this is to configure an obfs4 bridge where you make the obfs4 process try to bind on a port number under 1024. See: https://bugs.torproject.org/31091
2019-10-15hs-v3: Fix possible memory leak in error code pathDavid Goulet
Found by coverity CID 1454769. There were a second possible leak that is also fixed in this commit. Fixes #32063 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-11Merge branch 'ticket31682_042_01_squashed'Nick Mathewson
2019-10-11Correct comment on build_establish_intro_dos_extensionNick Mathewson
2019-10-11hs-v3: Fix implicit ssize_t to size_t conversionDavid Goulet
Found by Coverity. Fixes #31682 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-08hs-v3: Do not remove intro point if circuit existsDavid Goulet
When considering introduction point of a service's descriptor, do not remove an intro point that has an established or pending circuit. Fixes #31652 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-07Merge remote-tracking branch 'tor-github/pr/1317'Nick Mathewson
2019-10-07Merge branch 'ticket31548_035_01_squashed'Nick Mathewson
2019-10-07hs-v3: Make service pick the exact amount of intro pointsDavid Goulet
When encoding introduction points, we were not checking if that intro points had an established circuit. When botting up, the service will pick, by default, 3 + 2 intro points and the first 3 that establish, we use them and upload the descriptor. However, the intro point is removed from the service descriptor list only when the circuit has opened and we see that we have already enough intro points, it is then removed. But it is possible that the service establishes 3 intro points successfully before the other(s) have even opened yet. This lead to the service encoding extra intro points in the descriptor even though the circuit is not opened or might never establish (#31561). Fixes #31548 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-03hs: ADD_ONION NEW:BEST now defaults to ED25519-V3David Goulet
From RSA1024 (v2) to v3 now. Closes #29669 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-10-03Merge branch 'tor-github/pr/1276'George Kadianakis
2019-10-03Authorities reject relays running unsupported Tor release series.Nick Mathewson
Our minimum version is now 0.2.9.5-alpha. Series 0.3.0, 0.3.1, 0.3.2, 0.3.3, and 0.3.4 are now rejected. Also, extract this version-checking code into a new function, so we can test it. Closes ticket 31549. Also reject 0.3.5.0 through 0.3.5.6-rc as unstable.
2019-10-03Merge remote-tracking branch 'tor-github/pr/1358'Nick Mathewson
2019-10-03Merge remote-tracking branch 'tor-github/pr/1382'Nick Mathewson
2019-10-03control/control: Refactor some error handling codeteor
Split some protocol error handling out of connection_control_process_inbuf(). This refactor reduces the size of a practracker exception. Closes 31840.
2019-10-01Add comments to try to prevent recurrence of #31495.Nick Mathewson
There is a bad design choice in two of our configuration types, where the empty string encodes a value that is not the same as the default value. This design choice, plus an implementation mistake, meant that config_dup() did not preserve the value of routerset_t, and thereby caused bug #31495. This comment-only patch documents the two types with the problem, and suggests that implementors try to avoid it in the future. Closes ticket 31907.
2019-10-01Help users who try to use v2 client auth in v3 onions.George Kadianakis
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-30Merge branch 'tor-github/pr/1346'George Kadianakis
2019-09-26Merge remote-tracking branch 'tor-github/pr/1308'Nick Mathewson
2019-09-26lock: Avoid some undefined behaviour when freeing mutexes.teor
Fixes bug 31736; bugfix on 0.0.7.
2019-09-25Merge branch 'tor-github/pr/1341'George Kadianakis
2019-09-25Merge branch 'tor-github/pr/1345'George Kadianakis
2019-09-25Merge branch 'tor-github/pr/1309'George Kadianakis
2019-09-24feature/control: add a missing word to the send_control_done() commentteor
2019-09-23fix typo in commentRoger Dingledine
2019-09-23fix: Ticket #31589AmreshVenugopal
- The function `decrypt_desc_layer` has a cleaner interface. - `is_superencrypted_layer` changed from `int` -> `bool` [ticket details](https://trac.torproject.org/projects/tor/ticket/31589) add(changes/*): changes file fix(src/features/hs): is_superencrypted changed from `int` -> `bool` fix(changes/ticket31589): header add(changes/ticket31589): subsystem(onion services) to change
2019-09-19microdesc_parse: convert some ints to boolsNick Mathewson
Noted by ahf during review of #31675
2019-09-19microdesc_parse: Rename "next" label to "err".Nick Mathewson
2019-09-19Reindent microdesc_parse_fields().Nick Mathewson
I suggest reviewing this with -b: it should be whitespace-only.
2019-09-19Extract field-parsing code for microdesc_parse.cNick Mathewson
The code here parses the fields from the microdescriptor, including possible annotations, and stores them into a microdesc_t object. This commit is almost pure code movement; I recommend using --color-moved to review it.
2019-09-19Reindent microdesc_extract_body().Nick Mathewson
This commit is whitespace-only; I suggest reviewing with -b.
2019-09-19Extract the body-copying portion of microdesc parsingNick Mathewson
This code is logically independent of the rest of the function, and goes better in its own function. This is almost purely code movement; I suggest reviewing with --color-moved.
2019-09-19dirauth: reorder the checks in dirserv_router_has_valid_address()teor
To avoid a bug warning. Fixes 31793. Bug not in any release, no changes file required.
2019-09-18Merge branch 'bug30916_035' into bug30916_041Nick Mathewson
2019-09-18Avoid a crash if our "current" and "old" ntor onion keys are equalNick Mathewson
Our dimap code asserts if you try to add the same key twice; this can't happen if everything is running smoothly, but it's possible if you try to start a relay where secret_onion_key_ntor is the same as secret_onion_key_ntor.old. Fixes bug 30916; bugfix on 0.2.4.8-alpha when ntor keys were introduced.