aboutsummaryrefslogtreecommitdiff
path: root/src/feature
AgeCommit message (Collapse)Author
2020-09-22srv: Remove spammy debug logDavid Goulet
Fixes #40135 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-08-10small code tweaks to try to work around debian stable complaintsNick Mathewson
2020-06-30Downgrade "Bug: No entry found in extrainfo map" message.Nick Mathewson
This is not actually a bug! It can happen for a bunch of reasons, which all boil down to "trying to add an extrainfo for which we no longer have the corresponding routerinfo". Fixes #16016; bugfix on 0.2.6.3-alpha.
2020-06-30Merge branch 'tor-github/pr/1909' into maint-0.3.5Alexander Færøy
2020-06-29Merge remote-tracking branch 'tor-github/pr/1725/head' into maint-0.3.5Nick Mathewson
2020-05-30Preemptive circs should work with UseEntryGuards 0Roger Dingledine
Resume being willing to use preemptively-built circuits when UseEntryGuards is set to 0. We accidentally disabled this feature with that config setting (in our fix for #24469), leading to slower load times. Fixes bug 34303; bugfix on 0.3.3.2-alpha.
2020-05-06Use __attribute__((fallthrough)) rather than magic GCC comments.Nick Mathewson
GCC added an implicit-fallthrough warning a while back, where it would complain if you had a nontrivial "case:" block that didn't end with break, return, or something like that. Clang recently added the same thing. GCC, however, would let you annotate a fall-through as intended by any of various magic "/* fall through */" comments. Clang, however, only seems to like "__attribute__((fallthrough))". Fortunately, GCC accepts that too. A previous commit in this branch defined a FALLTHROUGH macro to do the right thing if GNUC is defined; here we replace all of our "fall through" comments with uses of that macro. This is an automated commit, made with the following perl one-liner: #!/usr/bin/perl -i -p s#/\* *falls? ?thr.*?\*/#FALLTHROUGH;#i;
2020-05-06Replace some "fall through" comments not at the end of a case.Nick Mathewson
2020-05-06Replace a "fall through" comment that was outside a switch.Nick Mathewson
2020-03-17Merge branch 'trove_2020_002_035' into maint-0.3.5Nick Mathewson
2020-03-17Fix TROVE-2020-003.George Kadianakis
Given that ed25519 public key validity checks are usually not needed and (so far) they are only necessary for onion addesses in the Tor protocol, we decided to fix this specific bug instance without modifying the rest of the codebase (see below for other fix approaches). In our minimal fix we check that the pubkey in hs_service_add_ephemeral() is valid and error out otherwise.
2020-03-17Trivial bugfixes found during TROVE investigation.George Kadianakis
2020-02-12hs-v3: Remove BUG() that can occur normallyDavid Goulet
Fixes #28992 Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-12Lowercase the BridgeDistribution value from torrc in descriptors.Alexander Færøy
This patch ensures that we always lowercase the BridgeDistribution from torrc in descriptors before submitting it. See: https://bugs.torproject.org/32753
2020-02-05When parsing tokens, reject early on spurious keys.Nick Mathewson
2020-02-05When parsing, reject >1024-bit RSA private keys sooner.Nick Mathewson
Private-key validation is fairly expensive for long keys in openssl, so we need to avoid it sooner.
2019-11-25Merge remote-tracking branch 'tor-github/pr/1464' into maint-0.3.5teor
2019-11-25Merge remote-tracking branch 'tor-github/pr/1395' into maint-0.3.5teor
2019-11-06Merge remote-tracking branch 'tor-github/pr/1340' into maint-0.3.5teor
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-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-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.
2019-09-18Extract expressions in construct_ntor_key_map()Nick Mathewson
No behavioral change here: this is just refactoring.
2019-09-06entrynodes: Make routine descriptor expiry notice logs less alarmingteor
When tor is missing descriptors for some primary entry guards, make the log message less alarming. It's normal for descriptors to expire, as long as tor fetches new ones soon after. Fixes bug 31657; bugfix on 0.3.3.1-alpha.
2019-09-02Change loglevel of message 'Hash of session info was not as expected'rl1987
2019-08-30Merge remote-tracking branch 'tor-github/pr/1181' into maint-0.3.5teor
2019-08-30Merge remote-tracking branch 'tor-github/pr/1117' into maint-0.3.5teor
2019-08-23hs: v3 single onion services fall back to 3-hop intro for unreachable nodesteor
Previously, v3 single onion services failed when all intro nodes were unreachable via a 1-hop path. Now, we select intros that are only available via a 3-hop path, and use a 3-hop path to connect to them. Fixes bug 23507; bugfix on 0.3.2.1-alpha.
2019-08-23hs: Always use a 3-hop path when a v3 single onion intro failsteor
Previously, we always used a 1-hop path, no matter how many times a v3 single onion intro failed. Fixes bug 23818; bugfix on 0.3.2.1-alpha.
2019-08-23hs: Always use a 3-hop path when a v3 single onion rend failsteor
Previously, we used a 1-hop path when a single onion rend failed immediately, and a 3-hop path when it failed after trying to build a circuit. Fixes bug 23818; bugfix on 0.3.2.1-alpha.
2019-08-23Merge branch 'bug23818_029' into bug23818_035teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/1066' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/1039' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/1034' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/1020' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/987' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/937' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/848' into maint-0.3.5teor
2019-08-09Merge remote-tracking branch 'tor-github/pr/1080' into maint-0.3.5teor
2019-08-08Merge branch 'ticket31343_029' into ticket31343_035Nick Mathewson
2019-07-19Set 'routerlist' global to NULL before freeing it.Nick Mathewson
There is other code that uses this value, and some of it is apparently reachable from inside router_dir_info_changed(), which routerlist_free() apparently calls. (ouch!) This is a minimal fix to try to resolve the issue without causing other problems. Fixes bug 31003. I'm calling this a bugfix on 0.1.2.2-alpha, where the call to router_dir_info_changed() was added to routerlist_free().
2019-06-19guard: Ignore marked for close circuit when changing state to openDavid Goulet
When we consider all circuits in "waiting for guard" state to be promoted to an "open" state, we were considering all circuits, even the one marked for close. This ultiamtely triggers a "circuit_has_opened()" called on the circuit that is marked for close which then leads to possible undesirable behaviors within a subsystem. For instance, the HS subsystem would be unable to find the authentication key of the introduction point circuit leading to a BUG() warning and a duplicate mark for close on the circuit. This commit also adds a unit test to make sure we never select marked for close circuits when upgrading its guard state from waiting for guard to open. Fixes #30871 Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-06-06Merge branch 'bug30781_034' into bug30781_035teor
Moved fix from src/or/routerparse.c to src/feature/dirparse/routerparse.c.
2019-05-31num_bridges_usable(): only count configured bridges.Nick Mathewson
When this function was implemented, it counted all the entry guards in the bridge set. But this included previously configured bridges, as well as currently configured ones! Instead, only count the _filtered_ bridges (ones that are configured and possibly reachable) as maybe usable. Fixes bug 29875; bugfix on 0.3.0.1-alpha.
2019-05-22Merge remote-tracking branch 'nickm/ticket30454_034_01_squashed' into ↵David Goulet
ticket30454_035_01
2019-05-17OOM-purge the DNS cache one part at a timeNick Mathewson
Previously we purged it in 1-hour increments -- but one-hour is the maximum TTL for the cache! Now we do it in 25%-TTL increments. Fixes bug 29617; bugfix on 0.3.5.1-alpha.
2019-05-14Add a --list-modules commandNick Mathewson
Closes ticket 30452.
2019-05-10Don't pass a NULL into a %s when logging client auth file load failureNick Mathewson
Fortunately, in 0.3.5.1-alpha we improved logging for various failure cases involved with onion service client auth. Unfortunately, for this one, we freed the file right before logging its name. Fortunately, tor_free() sets its pointer to NULL, so we didn't have a use-after-free bug. Unfortunately, passing NULL to %s is not defined. Fortunately, GCC 9.1.1 caught the issue! Unfortunately, nobody has actually tried building Tor with GCC 9.1.1 before. Or if they had, they didn't report the warning. Fixes bug 30475; bugfix on 0.3.5.1-alpha.